summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2016-11-17 21:27:12 +0100
committerZ.J. van de Weg <git@zjvandeweg.nl>2016-11-17 21:44:26 +0100
commit166ee0965bacc20e2ad1187321654499a9b0f825 (patch)
tree57e97bcfd0c819adbe6b3673bb45b4fc0124781c /spec
parent1607efa40081702488e22e560db2c1e30cd80093 (diff)
downloadgitlab-ce-166ee0965bacc20e2ad1187321654499a9b0f825.tar.gz
More refactoring, push present to base command
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/chat_commands/command_spec.rb9
-rw-r--r--spec/lib/gitlab/chat_name_token_spec.rb4
-rw-r--r--spec/models/project_spec.rb1
-rw-r--r--spec/services/chat_names/authorize_user_service_spec.rb2
4 files changed, 13 insertions, 3 deletions
diff --git a/spec/lib/gitlab/chat_commands/command_spec.rb b/spec/lib/gitlab/chat_commands/command_spec.rb
index 328187b5048..528e690d234 100644
--- a/spec/lib/gitlab/chat_commands/command_spec.rb
+++ b/spec/lib/gitlab/chat_commands/command_spec.rb
@@ -26,6 +26,15 @@ describe Gitlab::ChatCommands::Command, service: true do
end
end
+ context 'the user can not create an issue' do
+ let(:params) { { text: "issue create my new issue" } }
+
+ it 'rejects the actions' do
+ expect(subject[:response_type]).to be(:ephemeral)
+ expect(subject[:text]).to start_with('Whoops! That action is not allowed')
+ end
+ end
+
context 'issue is succesfully created' do
let(:params) { { text: "issue create my new issue" } }
diff --git a/spec/lib/gitlab/chat_name_token_spec.rb b/spec/lib/gitlab/chat_name_token_spec.rb
index 8d7e7a99059..10153682973 100644
--- a/spec/lib/gitlab/chat_name_token_spec.rb
+++ b/spec/lib/gitlab/chat_name_token_spec.rb
@@ -12,9 +12,9 @@ describe Gitlab::ChatNameToken, lib: true do
end
context 'when storing data' do
- let(:data) {
+ let(:data) do
{ key: 'value' }
- }
+ end
subject { described_class.new(@token) }
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index c74d9c282cf..d89a83cfc71 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -35,6 +35,7 @@ describe Project, models: true do
it { is_expected.to have_one(:hipchat_service).dependent(:destroy) }
it { is_expected.to have_one(:flowdock_service).dependent(:destroy) }
it { is_expected.to have_one(:assembla_service).dependent(:destroy) }
+ it { is_expected.to have_one(:mattermost_command_service).dependent(:destroy) }
it { is_expected.to have_one(:gemnasium_service).dependent(:destroy) }
it { is_expected.to have_one(:buildkite_service).dependent(:destroy) }
it { is_expected.to have_one(:bamboo_service).dependent(:destroy) }
diff --git a/spec/services/chat_names/authorize_user_service_spec.rb b/spec/services/chat_names/authorize_user_service_spec.rb
index f8c26e51bfc..d5178176526 100644
--- a/spec/services/chat_names/authorize_user_service_spec.rb
+++ b/spec/services/chat_names/authorize_user_service_spec.rb
@@ -17,7 +17,7 @@ describe ChatNames::AuthorizeUserService, services: true do
end
context 'when there are missing parameters' do
- let(:params) { { } }
+ let(:params) { {} }
it 'does not request a new token' do
is_expected.to be_nil