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>2020-03-05 03:07:49 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-05 03:07:49 +0300
commit77237c5a6b9044f58beabc54d3589e5fa09cbfba (patch)
treef43188047fe8955f6cf78e05ae9c2e8f6a019e0b /spec/requests/api/broadcast_messages_spec.rb
parent2fd92f2dc784ade9cb4e1c33dd60cbfad7b86818 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api/broadcast_messages_spec.rb')
-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 17b25d5c7cc..9bfbbe0daab 100644
--- a/spec/requests/api/broadcast_messages_spec.rb
+++ b/spec/requests/api/broadcast_messages_spec.rb
@@ -17,7 +17,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 target_path broadcast_type))
+ .to match_array(%w(id message starts_at ends_at color font active target_path broadcast_type dismissable))
end
end
@@ -28,7 +28,7 @@ describe API::BroadcastMessages do
expect(response).to have_gitlab_http_status(:ok)
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 target_path broadcast_type))
+ .to match_array(%w(id message starts_at ends_at color font active target_path broadcast_type dismissable))
end
end
@@ -111,6 +111,15 @@ describe API::BroadcastMessages do
expect(response).to have_gitlab_http_status(:bad_request)
end
+
+ it 'accepts an active dismissable value ' do
+ attrs = { message: 'new message', dismissable: true }
+
+ post api('/broadcast_messages', admin), params: attrs
+
+ expect(response).to have_gitlab_http_status(:created)
+ expect(json_response['dismissable']).to eq true
+ end
end
end
@@ -187,6 +196,15 @@ describe API::BroadcastMessages do
expect(response).to have_gitlab_http_status(:bad_request)
end
+
+ it 'accepts a new dismissable value ' do
+ attrs = { message: 'new message', dismissable: true }
+
+ put api("/broadcast_messages/#{message.id}", admin), params: attrs
+
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(json_response['dismissable']).to eq true
+ end
end
end