diff options
author | Semyon Pupkov <mail@semyonpupkov.com> | 2018-02-21 14:51:15 +0500 |
---|---|---|
committer | Semyon Pupkov <mail@semyonpupkov.com> | 2018-02-21 15:27:12 +0500 |
commit | 8f4c9e295e326648db695527d72f8d0070458c66 (patch) | |
tree | f93519877c0903b889d29db40ed912058a8f8901 /features/steps | |
parent | 11bf575fe64e55cc932c5629e2d8d103109e0b2b (diff) | |
download | gitlab-ce-8f4c9e295e326648db695527d72f8d0070458c66.tar.gz |
Move project pages spinach tests to Rspec
https://gitlab.com/gitlab-org/gitlab-ce/issues/23036
Diffstat (limited to 'features/steps')
-rw-r--r-- | features/steps/project/pages.rb | 152 |
1 files changed, 0 insertions, 152 deletions
diff --git a/features/steps/project/pages.rb b/features/steps/project/pages.rb deleted file mode 100644 index f03630e5a91..00000000000 --- a/features/steps/project/pages.rb +++ /dev/null @@ -1,152 +0,0 @@ -class Spinach::Features::ProjectPages < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'pages are enabled' do - allow(Gitlab.config.pages).to receive(:enabled).and_return(true) - allow(Gitlab.config.pages).to receive(:host).and_return('example.com') - allow(Gitlab.config.pages).to receive(:port).and_return(80) - allow(Gitlab.config.pages).to receive(:https).and_return(false) - end - - step 'pages are disabled' do - allow(Gitlab.config.pages).to receive(:enabled).and_return(false) - end - - step 'I visit the Project Pages' do - visit project_pages_path(@project) - end - - step 'I should see the usage of GitLab Pages' do - expect(page).to have_content('Configure pages') - end - - step 'I should see the "Pages" tab' do - page.within '.nav-sidebar' do - expect(page).to have_link('Pages') - end - end - - step 'I should not see the "Pages" tab' do - page.within '.nav-sidebar' do - expect(page).not_to have_link('Pages') - end - end - - step 'pages are deployed' do - pipeline = @project.pipelines.create(ref: 'HEAD', - sha: @project.commit('HEAD').sha, - source: :push, - protected: false) - - build = build(:ci_build, - project: @project, - pipeline: pipeline, - ref: 'HEAD', - legacy_artifacts_file: fixture_file_upload(Rails.root + 'spec/fixtures/pages.zip'), - legacy_artifacts_metadata: fixture_file_upload(Rails.root + 'spec/fixtures/pages.zip.meta') - ) - - result = ::Projects::UpdatePagesService.new(@project, build).execute - expect(result[:status]).to eq(:success) - end - - step 'I should be able to access the Pages' do - expect(page).to have_content('Access pages') - end - - step 'I should see that support for domains is disabled' do - expect(page).to have_content('Support for domains and certificates is disabled') - end - - step 'support for external domains is disabled' do - allow(Gitlab.config.pages).to receive(:external_http).and_return(nil) - allow(Gitlab.config.pages).to receive(:external_https).and_return(nil) - end - - step 'pages are exposed on external HTTP address' do - allow(Gitlab.config.pages).to receive(:external_http).and_return(['1.1.1.1:80']) - allow(Gitlab.config.pages).to receive(:external_https).and_return(nil) - end - - step 'pages are exposed on external HTTPS address' do - allow(Gitlab.config.pages).to receive(:external_http).and_return(['1.1.1.1:80']) - allow(Gitlab.config.pages).to receive(:external_https).and_return(['1.1.1.1:443']) - end - - step 'I should be able to add a New Domain' do - expect(page).to have_content('New Domain') - end - - step 'I visit add a new Pages Domain' do - visit new_project_pages_domain_path(@project) - end - - step 'I fill the domain' do - fill_in 'Domain', with: 'my.test.domain.com' - end - - step 'I click on "Create New Domain"' do - click_button 'Create New Domain' - end - - step 'I should see a new domain added' do - expect(page).to have_content('Domains (1)') - expect(page).to have_content('my.test.domain.com') - end - - step 'pages domain is added' do - @project.pages_domains.create!(domain: 'my.test.domain.com') - end - - step 'I should see error message that domain already exists' do - expect(page).to have_content('Domain has already been taken') - end - - step 'I should see that support for certificates is disabled' do - expect(page).to have_content('Support for custom certificates is disabled') - end - - step 'I fill the certificate and key' do - fill_in 'Certificate (PEM)', with: '-----BEGIN CERTIFICATE----- -MIICGzCCAYSgAwIBAgIBATANBgkqhkiG9w0BAQUFADAbMRkwFwYDVQQDExB0ZXN0 -LWNlcnRpZmljYXRlMB4XDTE2MDIxMjE0MzIwMFoXDTIwMDQxMjE0MzIwMFowGzEZ -MBcGA1UEAxMQdGVzdC1jZXJ0aWZpY2F0ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQ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rrcKJrxmEH1whzComybrMCQQDKV49nOBudRBAIgG4K -EnLzsRKISUHMZSJiYTYnablof8cKw1JaQduw7zgrUlLwnroSaAGX88+Jw1f5n2Lh -Vlg5AkBDdUGnrDLtYBCDEQYZHblrkc7ZAeCllDOWjxUV+uMqlCv8A4Ey6omvY57C -m6I8DkWVAQx8VPtozhvHjUw80rZHAkB55HWHAM3h13axKG0htCt7klhPsZHpx6MH -EPjGlXIT+aW2XiPmK3ZlCDcWIenE+lmtbOpI159Wpk8BGXs/s/xBAkEAlAY3ymgx -63BDJEwvOb2IaP8lDDxNsXx9XJNVvQbv5n15vNsLHbjslHfAhAbxnLQ1fLhUPqSi -nNp/xedE1YxutQ== ------END PRIVATE KEY-----' - end - - step 'I click Remove Pages' do - click_link 'Remove pages' - end - - step 'The Pages should get removed' do - expect(@project.pages_deployed?).to be_falsey - end -end |