4253: Users can manage their own repositories.
[arvados.git] / apps / workbench / test / integration / report_issue_test.rb
index ac9e596f8cb65053b6a217646757c5db2288ad80..4a15851636fba6f0502f741d181af42727a921af 100644 (file)
@@ -1,13 +1,8 @@
 require 'integration_helper'
-require 'selenium-webdriver'
-require 'headless'
 
 class ReportIssueTest < ActionDispatch::IntegrationTest
   setup do
-    headless = Headless.new
-    headless.start
-    Capybara.current_driver = :selenium
-
+    need_javascript
     @user_profile_form_fields = Rails.configuration.user_profile_form_fields
   end
 
@@ -17,9 +12,9 @@ class ReportIssueTest < ActionDispatch::IntegrationTest
 
   # test version info and report issue from help menu
   def check_version_info_and_report_issue_from_help_menu
-    within('.navbar-fixed-top') do
-      page.find("#arv-help").click
-      within('.dropdown-menu') do
+    within '.navbar-fixed-top' do
+      find('.help-menu > a').click
+      within '.help-menu .dropdown-menu' do
         assert page.has_link?('Tutorials and User guide'), 'No link - Tutorials and User guide'
         assert page.has_link?('API Reference'), 'No link - API Reference'
         assert page.has_link?('SDK Reference'), 'No link - SDK Reference'
@@ -47,11 +42,9 @@ class ReportIssueTest < ActionDispatch::IntegrationTest
     end
 
     # check report issue link
-    within('.navbar-fixed-top') do
-      page.find("#arv-help").click
-      within('.dropdown-menu') do
-        click_link 'Report a problem ...'
-      end
+    within '.navbar-fixed-top' do
+      find('.help-menu > a').click
+      find('.help-menu .dropdown-menu a', text: 'Report a problem ...').click
     end
 
     within '.modal-content' do
@@ -66,6 +59,11 @@ class ReportIssueTest < ActionDispatch::IntegrationTest
       # enter a report text and click on report
       page.find_field('report_issue_text').set 'my test report text'
       assert page.has_button?('Send problem report'), 'Send problem report button not enabled after entering text'
+
+      report = mock
+      report.expects(:deliver).returns true
+      IssueReporter.expects(:send_report).returns report
+
       click_button 'Send problem report'
 
       # ajax success updated button texts and added footer message