about summary refs log tree commit diff
path: root/spec/models/report_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/report_spec.rb')
-rw-r--r--spec/models/report_spec.rb16
1 files changed, 9 insertions, 7 deletions
diff --git a/spec/models/report_spec.rb b/spec/models/report_spec.rb
index 312954c9d..3d29c0219 100644
--- a/spec/models/report_spec.rb
+++ b/spec/models/report_spec.rb
@@ -54,7 +54,7 @@ describe Report do
   end
 
   describe 'resolve!' do
-    subject(:report) { Fabricate(:report, action_taken: false, action_taken_by_account_id: nil) }
+    subject(:report) { Fabricate(:report, action_taken_at: nil, action_taken_by_account_id: nil) }
 
     let(:acting_account) { Fabricate(:account) }
 
@@ -63,12 +63,13 @@ describe Report do
     end
 
     it 'records action taken' do
-      expect(report).to have_attributes(action_taken: true, action_taken_by_account_id: acting_account.id)
+      expect(report.action_taken?).to be true
+      expect(report.action_taken_by_account_id).to eq acting_account.id
     end
   end
 
   describe 'unresolve!' do
-    subject(:report) { Fabricate(:report, action_taken: true, action_taken_by_account_id: acting_account.id) }
+    subject(:report) { Fabricate(:report, action_taken_at: Time.now.utc, action_taken_by_account_id: acting_account.id) }
 
     let(:acting_account) { Fabricate(:account) }
 
@@ -77,23 +78,24 @@ describe Report do
     end
 
     it 'unresolves' do
-      expect(report).to have_attributes(action_taken: false, action_taken_by_account_id: nil)
+      expect(report.action_taken?).to be false
+      expect(report.action_taken_by_account_id).to be_nil
     end
   end
 
   describe 'unresolved?' do
     subject { report.unresolved? }
 
-    let(:report) { Fabricate(:report, action_taken: action_taken) }
+    let(:report) { Fabricate(:report, action_taken_at: action_taken) }
 
     context 'if action is taken' do
-      let(:action_taken) { true }
+      let(:action_taken) { Time.now.utc }
 
       it { is_expected.to be false }
     end
 
     context 'if action not is taken' do
-      let(:action_taken) { false }
+      let(:action_taken) { nil }
 
       it { is_expected.to be true }
     end