about summary refs log tree commit diff
path: root/spec/models/report_spec.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-01-17 10:45:25 +0100
committerClaire <claire.github-309c@sitedethib.com>2022-01-17 10:45:25 +0100
commitb3bf32a21e4dfc43737f50f15d3f258c16d0cf83 (patch)
tree37daa7d7725d3676115eea2c4d4a215bdd95c06d /spec/models/report_spec.rb
parent430d4427916b44e6a7c16db1899dfef2eec140fc (diff)
parent14f436c457560862fafabd753eb314c8b8a8e674 (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `app/views/admin/reports/show.html.haml`:
  Conflicts due to glitch-soc's theming system.
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