- group notification tests (#180)

  • group notification tests (#180)

  • removed unnessary return

diff --git a/lib/discourse_api/api/groups.rb b/lib/discourse_api/api/groups.rb
index 377587c..35b8af6 100644
--- a/lib/discourse_api/api/groups.rb
+++ b/lib/discourse_api/api/groups.rb
@@ -116,8 +116,7 @@ module DiscourseApi
       end
 
       def group_set_user_notification_level(group, user_id, notification_level)
-        response = post("/groups/#{group}/notifications?user_id=#{user_id}&notification_level=#{notification_level}")
-        response
+        post("/groups/#{group}/notifications?user_id=#{user_id}&notification_level=#{notification_level}")
       end
     end
   end
diff --git a/spec/discourse_api/api/groups_spec.rb b/spec/discourse_api/api/groups_spec.rb
index 2b0bd49..322dd16 100644
--- a/spec/discourse_api/api/groups_spec.rb
+++ b/spec/discourse_api/api/groups_spec.rb
@@ -106,5 +106,17 @@ describe DiscourseApi::API::Groups do
       end
     end
 
+    describe "group user notification level" do
+      before do
+        stub_post("http://localhost:3000/groups/mygroup/notifications?user_id=77&notification_level=3")
+      end
+
+      it "updates user's notification level for group" do
+        subject.group_set_user_notification_level("mygroup", 77, 3)
+        expect(a_post("http://localhost:3000/groups/mygroup/notifications?user_id=77&notification_level=3"))
+            .to have_been_made
+      end
+    end
+
   end
 end

GitHub sha: 516d7015