diff options
author | Mike Greiling <mike@pixelcog.com> | 2019-07-18 14:11:09 -0500 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2019-07-19 02:27:15 -0500 |
commit | 97b8f85e03f0b6dcfc5d85b92323be979bd27b09 (patch) | |
tree | 63c1d694be569bd91b77184dd883c50122d321f8 /spec/frontend/fixtures/deploy_keys.rb | |
parent | 1abe3e514f3fb1920862829cfc272ad7f73e714a (diff) | |
download | gitlab-ce-97b8f85e03f0b6dcfc5d85b92323be979bd27b09.tar.gz |
Move frontend fixtures into spec/frontend
Moves every fixture source file from
spec/javascripts to spec/frontend
Diffstat (limited to 'spec/frontend/fixtures/deploy_keys.rb')
-rw-r--r-- | spec/frontend/fixtures/deploy_keys.rb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/spec/frontend/fixtures/deploy_keys.rb b/spec/frontend/fixtures/deploy_keys.rb new file mode 100644 index 00000000000..fca233c6f59 --- /dev/null +++ b/spec/frontend/fixtures/deploy_keys.rb @@ -0,0 +1,43 @@ +require 'spec_helper' + +describe Projects::DeployKeysController, '(JavaScript fixtures)', type: :controller do + include JavaScriptFixturesHelpers + + let(:admin) { create(:admin) } + let(:namespace) { create(:namespace, name: 'frontend-fixtures' )} + let(:project) { create(:project_empty_repo, namespace: namespace, path: 'todos-project') } + let(:project2) { create(:project, :internal)} + let(:project3) { create(:project, :internal)} + let(:project4) { create(:project, :internal)} + + before(:all) do + clean_frontend_fixtures('deploy_keys/') + end + + before do + sign_in(admin) + end + + after do + remove_repository(project) + end + + render_views + + it 'deploy_keys/keys.json' do + create(:rsa_deploy_key_2048, public: true) + project_key = create(:deploy_key, key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCdMHEHyhRjbhEZVddFn6lTWdgEy5Q6Bz4nwGB76xWZI5YT/1WJOMEW+sL5zYd31kk7sd3FJ5L9ft8zWMWrr/iWXQikC2cqZK24H1xy+ZUmrRuJD4qGAaIVoyyzBL+avL+lF8J5lg6YSw8gwJY/lX64/vnJHUlWw2n5BF8IFOWhiw== dummy@gitlab.com') + internal_key = create(:deploy_key, key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDNd/UJWhPrpb+b/G5oL109y57yKuCxE+WUGJGYaj7WQKsYRJmLYh1mgjrl+KVyfsWpq4ylOxIfFSnN9xBBFN8mlb0Fma5DC7YsSsibJr3MZ19ZNBprwNcdogET7aW9I0In7Wu5f2KqI6e5W/spJHCy4JVxzVMUvk6Myab0LnJ2iQ== dummy@gitlab.com') + create(:deploy_keys_project, project: project, deploy_key: project_key) + create(:deploy_keys_project, project: project2, deploy_key: internal_key) + create(:deploy_keys_project, project: project3, deploy_key: project_key) + create(:deploy_keys_project, project: project4, deploy_key: project_key) + + get :index, params: { + namespace_id: project.namespace.to_param, + project_id: project + }, format: :json + + expect(response).to be_successful + end +end |