diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-01-31 15:12:02 +0100 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-03-06 09:47:44 -0600 |
commit | 5967c17e80ec0e17a2bdc615e18d1cb0a668f68f (patch) | |
tree | 5a55652f078056ae865afe1f37c5758a62fe614d /spec/presenters | |
parent | 2ee86441158076344a07f2715a148a5bdbe161b0 (diff) | |
download | gitlab-ce-5967c17e80ec0e17a2bdc615e18d1cb0a668f68f.tar.gz |
Introduced the deploy keys presenter
Diffstat (limited to 'spec/presenters')
-rw-r--r-- | spec/presenters/projects/settings/deploy_keys_presenter_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/presenters/projects/settings/deploy_keys_presenter_spec.rb b/spec/presenters/projects/settings/deploy_keys_presenter_spec.rb new file mode 100644 index 00000000000..26ed9ac93a0 --- /dev/null +++ b/spec/presenters/projects/settings/deploy_keys_presenter_spec.rb @@ -0,0 +1,28 @@ +require 'spec_helper' + +describe Projects::Settings::DeployKeysPresenter do + let(:project) { create(:empty_project) } + let(:user) { create(:user) } + + subject(:presenter) do + described_class.new(project, current_user: user) + end + + it 'inherits from Gitlab::View::Presenter::Simple' do + expect(described_class.superclass).to eq(Gitlab::View::Presenter::Simple) + end + + describe '#enabled_keys' do + let(:deploy_key) do + create(:deploy_keys_project, project: project).deploy_key + end + + it 'returns project keys' do + expect(presenter.enabled_keys).to eq [deploy_key] + end + + it 'does not contain enabled_keys inside available_keys' do + expect(presenter.available_keys).not_to include deploy_key + end + end +end |