Replaces find(:first) calls.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10928 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-12-03 18:21:32 +00:00
parent 013c6fe009
commit 31c33f462d
31 changed files with 101 additions and 96 deletions
+18 -18
View File
@@ -29,8 +29,8 @@ class JournalObserverTest < ActiveSupport::TestCase
# context: issue_updated notified_events
def test_create_should_send_email_notification_with_issue_updated
issue = Issue.find(:first)
user = User.find(:first)
issue = Issue.first
user = User.first
journal = issue.init_journal(user, issue)
with_settings :notified_events => %w(issue_updated) do
@@ -40,8 +40,8 @@ class JournalObserverTest < ActiveSupport::TestCase
end
def test_create_should_not_send_email_notification_with_notify_set_to_false
issue = Issue.find(:first)
user = User.find(:first)
issue = Issue.first
user = User.first
journal = issue.init_journal(user, issue)
journal.notify = false
@@ -52,8 +52,8 @@ class JournalObserverTest < ActiveSupport::TestCase
end
def test_create_should_not_send_email_notification_without_issue_updated
issue = Issue.find(:first)
user = User.find(:first)
issue = Issue.first
user = User.first
journal = issue.init_journal(user, issue)
with_settings :notified_events => [] do
@@ -64,8 +64,8 @@ class JournalObserverTest < ActiveSupport::TestCase
# context: issue_note_added notified_events
def test_create_should_send_email_notification_with_issue_note_added
issue = Issue.find(:first)
user = User.find(:first)
issue = Issue.first
user = User.first
journal = issue.init_journal(user, issue)
journal.notes = 'This update has a note'
@@ -76,8 +76,8 @@ class JournalObserverTest < ActiveSupport::TestCase
end
def test_create_should_not_send_email_notification_without_issue_note_added
issue = Issue.find(:first)
user = User.find(:first)
issue = Issue.first
user = User.first
journal = issue.init_journal(user, issue)
journal.notes = 'This update has a note'
@@ -89,8 +89,8 @@ class JournalObserverTest < ActiveSupport::TestCase
# context: issue_status_updated notified_events
def test_create_should_send_email_notification_with_issue_status_updated
issue = Issue.find(:first)
user = User.find(:first)
issue = Issue.first
user = User.first
issue.init_journal(user, issue)
issue.status = IssueStatus.last
@@ -101,8 +101,8 @@ class JournalObserverTest < ActiveSupport::TestCase
end
def test_create_should_not_send_email_notification_without_issue_status_updated
issue = Issue.find(:first)
user = User.find(:first)
issue = Issue.first
user = User.first
issue.init_journal(user, issue)
issue.status = IssueStatus.last
@@ -114,8 +114,8 @@ class JournalObserverTest < ActiveSupport::TestCase
# context: issue_priority_updated notified_events
def test_create_should_send_email_notification_with_issue_priority_updated
issue = Issue.find(:first)
user = User.find(:first)
issue = Issue.first
user = User.first
issue.init_journal(user, issue)
issue.priority = IssuePriority.last
@@ -126,8 +126,8 @@ class JournalObserverTest < ActiveSupport::TestCase
end
def test_create_should_not_send_email_notification_without_issue_priority_updated
issue = Issue.find(:first)
user = User.find(:first)
issue = Issue.first
user = User.first
issue.init_journal(user, issue)
issue.priority = IssuePriority.last