From 0bf2e8d5cb7a34f3bc932d88f0ec4293320aca4d Mon Sep 17 00:00:00 2001 From: James McKinney Date: Sun, 16 Oct 2011 20:12:26 -0400 Subject: allow specs to run independently --- spec/models/user_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'spec/models/user_spec.rb') diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 751a61060..f77e39ab4 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -193,7 +193,7 @@ describe User, "when reindexing referencing models" do end describe User, "when checking abilities" do - fixtures :users + fixtures :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things before do @user = users(:bob_smith_user) @@ -283,7 +283,7 @@ describe User, "when setting a profile photo" do end describe User, "when unconfirmed" do - fixtures :users + fixtures :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things before do @user = users(:unconfirmed_user) @@ -295,7 +295,7 @@ describe User, "when unconfirmed" do end describe User, "when emails have bounced" do - fixtures :users + fixtures :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things it "should record bounces" do User.record_bounce_for_email("bob@localhost", "The reason we think the email bounced (e.g. a bounce message)") -- cgit v1.2.3 From 7443755c774990ea4f359856a7cb7c027a1bfc66 Mon Sep 17 00:00:00 2001 From: James McKinney Date: Mon, 17 Oct 2011 01:14:14 -0400 Subject: add safe_mock_model to safely handle #to_ary calls in 1.9 --- spec/models/user_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'spec/models/user_spec.rb') diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 751a61060..7d68c978b 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -152,10 +152,10 @@ end describe User, "when reindexing referencing models" do before do - @request_event = mock_model(InfoRequestEvent, :xapian_mark_needs_index => true) - @request = mock_model(InfoRequest, :info_request_events => [@request_event]) - @comment_event = mock_model(InfoRequestEvent, :xapian_mark_needs_index => true) - @comment = mock_model(Comment, :info_request_events => [@comment_event]) + @request_event = safe_mock_model(InfoRequestEvent, :xapian_mark_needs_index => true) + @request = safe_mock_model(InfoRequest, :info_request_events => [@request_event]) + @comment_event = safe_mock_model(InfoRequestEvent, :xapian_mark_needs_index => true) + @comment = safe_mock_model(Comment, :info_request_events => [@comment_event]) @user = User.new(:comments => [@comment], :info_requests => [@request]) end -- cgit v1.2.3