summaryrefslogtreecommitdiff
path: root/spec/presenters/projects
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2017-03-06 14:42:04 -0600
committerJose Ivan Vargas <jvargas@gitlab.com>2017-03-06 14:42:04 -0600
commit002d3a3e72de57c76a077ed5d09e857243c7effd (patch)
tree7143f087c657e696bbdc44e41dae94de13c01210 /spec/presenters/projects
parent55b07533a9bede54728be91f97678a67f431c6b5 (diff)
downloadgitlab-ce-002d3a3e72de57c76a077ed5d09e857243c7effd.tar.gz
Added test case for the avaiable project keys
Diffstat (limited to 'spec/presenters/projects')
-rw-r--r--spec/presenters/projects/settings/deploy_keys_presenter_spec.rb15
1 files changed, 11 insertions, 4 deletions
diff --git a/spec/presenters/projects/settings/deploy_keys_presenter_spec.rb b/spec/presenters/projects/settings/deploy_keys_presenter_spec.rb
index 7245631a388..6443f86b6a1 100644
--- a/spec/presenters/projects/settings/deploy_keys_presenter_spec.rb
+++ b/spec/presenters/projects/settings/deploy_keys_presenter_spec.rb
@@ -36,20 +36,27 @@ describe Projects::Settings::DeployKeysPresenter do
end
describe '#available_keys/#available_project_keys' do
+ let(:other_deploy_key) { create(:another_deploy_key) }
+
+ before do
+ project_key = create(:deploy_keys_project, deploy_key: other_deploy_key)
+ project_key.project.add_developer(user)
+ end
+
it 'returns the current available_keys' do
- expect(presenter.available_keys).to be_empty
+ expect(presenter.available_keys).not_to be_empty
end
it 'returns the current available_project_keys' do
- expect(presenter.available_project_keys).to be_empty
+ expect(presenter.available_project_keys).not_to be_empty
end
it 'returns false if any available_project_keys are enabled' do
- expect(presenter.any_available_project_keys_enabled?).to eq(false)
+ expect(presenter.any_available_project_keys_enabled?).to eq(true)
end
it 'returns the available_project_keys size' do
- expect(presenter.available_project_keys_size).to eq(0)
+ expect(presenter.available_project_keys_size).to eq(1)
end
it 'shows if there is an available key' do