DEV: Fix rubocop issues

DEV: Fix rubocop issues

diff --git a/spec/discourse_api/api/api_key_spec.rb b/spec/discourse_api/api/api_key_spec.rb
index c3cc710..4e00342 100644
--- a/spec/discourse_api/api/api_key_spec.rb
+++ b/spec/discourse_api/api/api_key_spec.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 require 'spec_helper'
 
 describe DiscourseApi::API::ApiKey do
@@ -48,7 +49,7 @@ describe DiscourseApi::API::ApiKey do
     before do
       url = "#{host}/admin/users/2/revoke_api_key.json"
       stub_delete(url).to_return(body: "",
-      headers: { content_type: "application/json" })
+                                 headers: { content_type: "application/json" })
     end
 
     it "returns 200" do
@@ -95,7 +96,7 @@ describe DiscourseApi::API::ApiKey do
     before do
       url = "#{host}/admin/api/key"
       stub_put(url).to_return(body: fixture("regenerate_api_key.json"),
-                                 headers: { content_type: "application/json" })
+                              headers: { content_type: "application/json" })
     end
 
     it "requests the correct resource" do
diff --git a/spec/discourse_api/api/backups_spec.rb b/spec/discourse_api/api/backups_spec.rb
index 5b0f658..1de519d 100644
--- a/spec/discourse_api/api/backups_spec.rb
+++ b/spec/discourse_api/api/backups_spec.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
 require 'spec_helper'
 
 describe DiscourseApi::API::Backups do
-  subject { DiscourseApi::Client.new("#{host}", "test_d7fd0429940", "test_user" )}
+  subject { DiscourseApi::Client.new("#{host}", "test_d7fd0429940", "test_user") }
 
   describe "#backups" do
     before do
diff --git a/spec/discourse_api/api/badges_spec.rb b/spec/discourse_api/api/badges_spec.rb
index 45ba708..4d98d9c 100644
--- a/spec/discourse_api/api/badges_spec.rb
+++ b/spec/discourse_api/api/badges_spec.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
 require 'spec_helper'
 
 describe DiscourseApi::API::Badges do
-  subject { DiscourseApi::Client.new("#{host}", "test_d7fd0429940", "test_user" )}
+  subject { DiscourseApi::Client.new("#{host}", "test_d7fd0429940", "test_user") }
 
   describe "#badges" do
     before do
diff --git a/spec/discourse_api/api/categories_spec.rb b/spec/discourse_api/api/categories_spec.rb
index 2fc6e93..dc30029 100644
--- a/spec/discourse_api/api/categories_spec.rb
+++ b/spec/discourse_api/api/categories_spec.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
 require 'spec_helper'
 
 describe DiscourseApi::API::Categories do
-  subject { DiscourseApi::Client.new("#{host}", "test_d7fd0429940", "test_user" )}
+  subject { DiscourseApi::Client.new("#{host}", "test_d7fd0429940", "test_user") }
 
   describe "#categories" do
     before do
@@ -42,8 +43,8 @@ describe DiscourseApi::API::Categories do
   describe '#category_top_topics' do
     before do
       stub_get("#{host}/c/category-slug/l/top.json")
-      .to_return(
-        body: fixture("category_topics.json"), 
+        .to_return(
+        body: fixture("category_topics.json"),
         headers: { content_type: "application/json" }
       )
     end
@@ -57,8 +58,8 @@ describe DiscourseApi::API::Categories do
   describe '#category_new_topics' do
     before do
       stub_get("#{host}/c/category-slug/l/new.json")
-      .to_return(
-        body: fixture("category_topics.json"), 
+        .to_return(
+        body: fixture("category_topics.json"),
         headers: { content_type: "application/json" }
       )
     end
@@ -74,14 +75,14 @@ describe DiscourseApi::API::Categories do
       stub_post("#{host}/categories")
       subject.create_category(name: "test_category", color: "283890", text_color: "FFFFFF",
                               description: "This is a description",
-                              permissions: {"group_1" => 1, "admins" => 1})
+                              permissions: { "group_1" => 1, "admins" => 1 })
     end
-    
+
     it "makes a create category request" do
       expect(a_post("#{host}/categories").with(body:
           "color=283890&description=This+is+a+description&name=test_category&parent_category_id&permissions%5Badmins%5D=1&permissions%5Bgroup_1%5D=1&text_color=FFFFFF")
         ).to have_been_made
     end
-  end  
+  end
 
 end
diff --git a/spec/discourse_api/api/email_spec.rb b/spec/discourse_api/api/email_spec.rb
index 92fed89..0867e91 100644
--- a/spec/discourse_api/api/email_spec.rb
+++ b/spec/discourse_api/api/email_spec.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
 require 'spec_helper'
 
 describe DiscourseApi::API::Email do
-  subject { DiscourseApi::Client.new("#{host}", "test_d7fd0429940", "test_user" )}
+  subject { DiscourseApi::Client.new("#{host}", "test_d7fd0429940", "test_user") }
 
   describe "#email_settings" do
     before do
diff --git a/spec/discourse_api/api/groups_spec.rb b/spec/discourse_api/api/groups_spec.rb
index 1d84cc8..2468220 100644
--- a/spec/discourse_api/api/groups_spec.rb
+++ b/spec/discourse_api/api/groups_spec.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
 require 'spec_helper'
 
 describe DiscourseApi::API::Groups do
-  subject { DiscourseApi::Client.new("#{host}", "test_d7fd0429940", "test_user" )}
+  subject { DiscourseApi::Client.new("#{host}", "test_d7fd0429940", "test_user") }
 
   describe "#groups" do
     before do
@@ -51,28 +52,28 @@ describe DiscourseApi::API::Groups do
       it "adds a single member by username" do
         subject.group_add(123, username: "sam")
         expect(a_request(:put, "#{host}/admin/groups/123/members.json").
-                with(body: {usernames: "sam"})
+                with(body: { usernames: "sam" })
               ).to have_been_made
       end
 
       it "adds an array of members by username" do
         subject.group_add(123, usernames: ["sam", "jeff"])
         expect(a_request(:put, "#{host}/admin/groups/123/members.json").
-                with(body: {usernames: "sam,jeff"})
+                with(body: { usernames: "sam,jeff" })
               ).to have_been_made
       end
 
       it "adds a single member by user_id" do
         subject.group_add(123, user_id: 456)
         expect(a_request(:put, "#{host}/admin/groups/123/members.json").
-                with(body: {user_ids: "456"})
+                with(body: { user_ids: "456" })
               ).to have_been_made
       end
 
       it "adds an array of members by user_id" do
         subject.group_add(123, user_id: [123, 456])
         expect(a_request(:put, "#{host}/admin/groups/123/members.json").
-                with(body: {user_ids: "123,456"})
+                with(body: { user_ids: "123,456" })
               ).to have_been_made
       end
     end
@@ -122,7 +123,7 @@ describe DiscourseApi::API::Groups do
       it "updates user's notification level for group" do
         subject.group_set_user_notification_level("mygroup", 77, 3)
         expect(a_post("#{host}/groups/mygroup/notifications?user_id=77&notification_level=3"))
-            .to have_been_made
+          .to have_been_made
       end
     end
 
diff --git a/spec/discourse_api/api/notifications_spec.rb b/spec/discourse_api/api/notifications_spec.rb
index 381e6f0..7036a08 100644
--- a/spec/discourse_api/api/notifications_spec.rb
+++ b/spec/discourse_api/api/notifications_spec.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 require 'spec_helper'
 
 describe DiscourseApi::API::Notifications do
diff --git a/spec/discourse_api/api/params_spec.rb b/spec/discourse_api/api/params_spec.rb
index 3de4c1b..ef2054d 100644
--- a/spec/discourse_api/api/params_spec.rb
+++ b/spec/discourse_api/api/params_spec.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 require 'spec_helper'
 
 describe DiscourseApi::API::Params do
@@ -6,31 +7,31 @@ describe DiscourseApi::API::Params do
   end
 
   it "should raise on missing required params" do
-    expect { params_for({o1: "test"}).to_h }.to raise_error(ArgumentError)
+    expect { params_for({ o1: "test" }).to_h }.to raise_error(ArgumentError)
   end
 

[... diff too long, it was truncated ...]

GitHub sha: f9d1808d

1 Like