DEV: Minor fixes to spec.

DEV: Minor fixes to spec.

From 88d5346aad4ed678fd1a07bc1fa2daa38751c95a Mon Sep 17 00:00:00 2001
From: Guo Xiang Tan <tgx_world@hotmail.com>
Date: Fri, 5 Oct 2018 12:55:55 +0800
Subject: [PATCH] DEV: Minor fixes to spec.


diff --git a/spec/integration/assign_spec.rb b/spec/integration/assign_spec.rb
index bc1c3ec..373248b 100644
--- a/spec/integration/assign_spec.rb
+++ b/spec/integration/assign_spec.rb
@@ -61,11 +61,12 @@ describe 'integration tests' do
   describe "on before_staff_flag_action event" do
     let(:post) { Fabricate(:post) }
     let(:user) { Fabricate(:user) }
-    let(:args) {{ post: post, user: user }}
+    let(:args) { { post: post, user: user } }
 
     before do
       SiteSetting.assign_locks_flags = true
-      TopicCustomField.create(
+
+      TopicCustomField.create!(
         topic_id: post.topic_id,
         name: TopicAssigner::ASSIGNED_TO_ID,
         value: Discourse.system_user.id
@@ -73,12 +74,13 @@ describe 'integration tests' do
     end
 
     it "do not raise error if topic is deleted" do
-      expect { DiscourseEvent.trigger(:before_staff_flag_action, args) }.to raise_error(Discourse::InvalidAccess)
+      expect { DiscourseEvent.trigger(:before_staff_flag_action, args) }
+        .to raise_error(Discourse::InvalidAccess)
 
       post.topic.destroy!
       post.reload
 
-      expect { DiscourseEvent.trigger(:before_staff_flag_action, args) }.not_to raise_error
+      DiscourseEvent.trigger(:before_staff_flag_action, args)
     end
   end
 end

GitHub

hmm are we missing linting in assign?

1 Like