]> source.dussan.org Git - redmine.git/commitdiff
Fixes ui tests.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 13 Mar 2017 21:39:04 +0000 (21:39 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 13 Mar 2017 21:39:04 +0000 (21:39 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@16397 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/ui/issues_test_ui.rb
test/ui/sudo_mode_test_ui.rb

index 0ab5d6a8b39230bf566c93a30d2d31dc25079951..e19497edc2daec8ac24f2db5564a23db6dfc5577 100644 (file)
@@ -206,8 +206,8 @@ class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base
       :trackers => Tracker.where(:name => 'Feature request')
     )
 
-    Role.non_member.add_permission! :edit_issues
-    Role.non_member.remove_permission! :add_issues, :add_issue_notes
+    Role.non_member.add_permission! :edit_issues, :add_issues
+    Role.non_member.remove_permission! :add_issue_notes
 
     log_user('someone', 'foo')
     visit '/issues/1'
index f5e6f20b292cf2dcffa8a7aade5b449e265252e4..fc79c33a2ea7969ffdf72e0908899c5f5a47219e 100644 (file)
@@ -22,10 +22,18 @@ class Redmine::UiTest::SudoModeTest < Redmine::UiTest::Base
 
   def setup
     Redmine::SudoMode.stubs(:enabled?).returns(true)
+    super
+  end
+
+  def teardown
+    travel_back
+    super
   end
 
   def test_add_user
     log_user('admin', 'admin')
+    expire_sudo_mode!
+    
     visit '/users/new'
 
     assert_difference 'User.count' do
@@ -50,4 +58,11 @@ class Redmine::UiTest::SudoModeTest < Redmine::UiTest::Base
       end
     end
   end
+
+  private
+
+  # sudo mode is active after sign, let it expire by advancing the time
+  def expire_sudo_mode!
+    travel_to 20.minutes.from_now
+  end
 end