summaryrefslogtreecommitdiff
path: root/spec/controllers/groups
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-11-14 20:42:44 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-11-17 15:10:13 -0200
commit198fe1bfc281ed465b94bb0b0a077f607d3d9fc7 (patch)
tree30cbf8ae9c7c9629f967ed58e343261e4eb13991 /spec/controllers/groups
parent0aac2e0706cd767993148826d723aa3641cbb2a4 (diff)
downloadgitlab-ce-198fe1bfc281ed465b94bb0b0a077f607d3d9fc7.tar.gz
Add toggle_subscription action to Groups::LabelsController
Diffstat (limited to 'spec/controllers/groups')
-rw-r--r--spec/controllers/groups/labels_controller_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/controllers/groups/labels_controller_spec.rb b/spec/controllers/groups/labels_controller_spec.rb
new file mode 100644
index 00000000000..899d8ebd12b
--- /dev/null
+++ b/spec/controllers/groups/labels_controller_spec.rb
@@ -0,0 +1,22 @@
+require 'spec_helper'
+
+describe Groups::LabelsController do
+ let(:group) { create(:group) }
+ let(:user) { create(:user) }
+
+ before do
+ group.add_owner(user)
+
+ sign_in(user)
+ end
+
+ describe 'POST #toggle_subscription' do
+ it 'allows user to toggle subscription on group labels' do
+ label = create(:group_label, group: group)
+
+ post :toggle_subscription, group_id: group.to_param, id: label.to_param
+
+ expect(response).to have_http_status(200)
+ end
+ end
+end