Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-12 06:07:34 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-12 06:07:34 +0300
commit2ccde70b80730fd52f75797e7d711748fb5b769b (patch)
treebb5b1c2dfa4f99381eabcb0f7783e55d9fad073d /spec/requests
parent2e3cbf7d89815e2915f77677388c49b48f8d20c3 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/broadcast_messages_spec.rb22
1 files changed, 20 insertions, 2 deletions
diff --git a/spec/requests/api/broadcast_messages_spec.rb b/spec/requests/api/broadcast_messages_spec.rb
index 541acb29857..9dc639a25a2 100644
--- a/spec/requests/api/broadcast_messages_spec.rb
+++ b/spec/requests/api/broadcast_messages_spec.rb
@@ -29,7 +29,7 @@ describe API::BroadcastMessages do
expect(response).to include_pagination_headers
expect(json_response).to be_kind_of(Array)
expect(json_response.first.keys)
- .to match_array(%w(id message starts_at ends_at color font active))
+ .to match_array(%w(id message starts_at ends_at color font active target_path))
end
end
@@ -52,7 +52,7 @@ describe API::BroadcastMessages do
expect(response).to have_gitlab_http_status(200)
expect(json_response['id']).to eq message.id
expect(json_response.keys)
- .to match_array(%w(id message starts_at ends_at color font active))
+ .to match_array(%w(id message starts_at ends_at color font active target_path))
end
end
@@ -100,6 +100,15 @@ describe API::BroadcastMessages do
expect(json_response['color']).to eq attrs[:color]
expect(json_response['font']).to eq attrs[:font]
end
+
+ it 'accepts a target path' do
+ attrs = attributes_for(:broadcast_message, target_path: "*/welcome")
+
+ post api('/broadcast_messages', admin), params: attrs
+
+ expect(response).to have_gitlab_http_status(201)
+ expect(json_response['target_path']).to eq attrs[:target_path]
+ end
end
end
@@ -150,6 +159,15 @@ describe API::BroadcastMessages do
expect(response).to have_gitlab_http_status(200)
expect { message.reload }.to change { message.message }.to('new message')
end
+
+ it 'accepts a new target_path' do
+ attrs = { target_path: '*/welcome' }
+
+ put api("/broadcast_messages/#{message.id}", admin), params: attrs
+
+ expect(response).to have_gitlab_http_status(200)
+ expect(json_response['target_path']).to eq attrs[:target_path]
+ end
end
end