Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'features/steps')
-rw-r--r--features/steps/profile/emails.rb48
-rw-r--r--features/steps/project/merge_requests/acceptance.rb55
-rw-r--r--features/steps/project/project_group_links.rb51
-rw-r--r--features/steps/project/team_management.rb87
-rw-r--r--features/steps/project/wiki.rb195
5 files changed, 0 insertions, 436 deletions
diff --git a/features/steps/profile/emails.rb b/features/steps/profile/emails.rb
deleted file mode 100644
index 4f44f932a6d..00000000000
--- a/features/steps/profile/emails.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-class Spinach::Features::ProfileEmails < Spinach::FeatureSteps
- include SharedAuthentication
-
- step 'I visit profile emails page' do
- visit profile_emails_path
- end
-
- step 'I should see my emails' do
- expect(page).to have_content(@user.email)
- @user.emails.each do |email|
- expect(page).to have_content(email.email)
- end
- end
-
- step 'I submit new email "my@email.com"' do
- fill_in "email_email", with: "my@email.com"
- click_button "Add"
- end
-
- step 'I should see new email "my@email.com"' do
- email = @user.emails.find_by(email: "my@email.com")
- expect(email).not_to be_nil
- expect(page).to have_content("my@email.com")
- end
-
- step 'I should not see email "my@email.com"' do
- email = @user.emails.find_by(email: "my@email.com")
- expect(email).to be_nil
- expect(page).not_to have_content("my@email.com")
- end
-
- step 'I click link "Remove" for "my@email.com"' do
- # there should only be one remove button at this time
- click_link "Remove"
- # force these to reload as they have been cached
- @user.emails.reload
- end
-
- step 'I submit duplicate email @user.email' do
- fill_in "email_email", with: @user.email
- click_button "Add"
- end
-
- step 'I should not have @user.email added' do
- email = @user.emails.find_by(email: @user.email)
- expect(email).to be_nil
- end
-end
diff --git a/features/steps/project/merge_requests/acceptance.rb b/features/steps/project/merge_requests/acceptance.rb
deleted file mode 100644
index 3c640e3512a..00000000000
--- a/features/steps/project/merge_requests/acceptance.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps
- include LoginHelpers
- include WaitForRequests
-
- step 'I am on the Merge Request detail page' do
- visit merge_request_path(@merge_request)
- end
-
- step 'I am on the Merge Request detail with note anchor page' do
- visit merge_request_path(@merge_request, anchor: 'note_123')
- end
-
- step 'I uncheck the "Remove source branch" option' do
- uncheck('Remove source branch')
- end
-
- step 'I check the "Remove source branch" option' do
- check('Remove source branch')
- end
-
- step 'I click on Accept Merge Request' do
- click_button('Merge')
- end
-
- step 'I should see the Remove Source Branch button' do
- expect(page).to have_selector('.js-remove-branch-button')
-
- # Wait for View Resource requests to complete so they don't blow up if they are
- # only handled after `DatabaseCleaner` has already run
- wait_for_requests
- end
-
- step 'I should not see the Remove Source Branch button' do
- expect(page).not_to have_selector('.js-remove-branch-button')
-
- # Wait for View Resource requests to complete so they don't blow up if they are
- # only handled after `DatabaseCleaner` has already run
- wait_for_requests
- end
-
- step 'There is an open Merge Request' do
- @user = create(:user)
- @project = create(:project, :public, :repository)
- @project_member = create(:project_member, :developer, user: @user, project: @project)
- @merge_request = create(:merge_request, :with_diffs, :simple, source_project: @project)
- end
-
- step 'I am signed in as a developer of the project' do
- sign_in(@user)
- end
-
- step 'I should see merge request merged' do
- expect(page).to have_content('The changes were merged into')
- end
-end
diff --git a/features/steps/project/project_group_links.rb b/features/steps/project/project_group_links.rb
deleted file mode 100644
index 47ee31786a6..00000000000
--- a/features/steps/project/project_group_links.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-class Spinach::Features::ProjectGroupLinks < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
- include Select2Helper
-
- step 'I should see project already shared with group "Ops"' do
- page.within '.project-members-groups' do
- expect(page).to have_content "Ops"
- end
- end
-
- step 'I should see project is not shared with group "Market"' do
- page.within '.project-members-groups' do
- expect(page).not_to have_content "Market"
- end
- end
-
- step 'I select group "Market" for share' do
- click_link 'Share with group'
- group = Group.find_by(path: 'market')
- select2(group.id, from: "#link_group_id")
- select "Master", from: 'link_group_access'
- click_button "Share"
- end
-
- step 'I should see project is shared with group "Market"' do
- page.within '.project-members-groups' do
- expect(page).to have_content "Market"
- end
- end
-
- step 'project "Shop" is shared with group "Ops"' do
- group = create(:group, name: 'Ops')
- share_link = project.project_group_links.new(group_access: Gitlab::Access::MASTER)
- share_link.group_id = group.id
- share_link.save!
- end
-
- step 'project "Shop" is not shared with group "Market"' do
- create(:group, name: 'Market', path: 'market')
- end
-
- step 'I visit project group links page' do
- visit project_group_links_path(project)
- end
-
- def project
- @project ||= Project.find_by_name "Shop"
- end
-end
diff --git a/features/steps/project/team_management.rb b/features/steps/project/team_management.rb
deleted file mode 100644
index 5c4025ace34..00000000000
--- a/features/steps/project/team_management.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
- include Select2Helper
-
- step 'I should not see "Dmitriy" in team list' do
- user = User.find_by(name: "Dmitriy")
- expect(page).not_to have_content(user.name)
- expect(page).not_to have_content(user.username)
- end
-
- step 'I should see "Mike" in team list as "Reporter"' do
- user = User.find_by(name: 'Mike')
- project_member = project.project_members.find_by(user_id: user.id)
- page.within "#project_member_#{project_member.id}" do
- expect(page).to have_content('Mike')
- expect(page).to have_content('Reporter')
- end
- end
-
- step 'gitlab user "Mike"' do
- create(:user, name: "Mike")
- end
-
- step 'gitlab user "Dmitriy"' do
- create(:user, name: "Dmitriy")
- end
-
- step '"Dmitriy" is "Shop" developer' do
- user = User.find_by(name: "Dmitriy")
- project = Project.find_by(name: "Shop")
- project.team << [user, :developer]
- end
-
- step 'I own project "Website"' do
- @project = create(:project, name: "Website", namespace: @user.namespace)
- @project.team << [@user, :master]
- end
-
- step '"Mike" is "Website" reporter' do
- user = User.find_by(name: "Mike")
- project = Project.find_by(name: "Website")
- project.team << [user, :reporter]
- end
-
- step 'I click link "Import team from another project"' do
- page.within '.users-project-form' do
- click_link "Import"
- end
- end
-
- When 'I submit "Website" project for import team' do
- project = Project.find_by(name: "Website")
- select project.name_with_namespace, from: 'source_project_id'
- click_button 'Import'
- end
-
- step 'I click cancel link for "Dmitriy"' do
- project = Project.find_by(name: "Shop")
- user = User.find_by(name: 'Dmitriy')
- project_member = project.project_members.find_by(user_id: user.id)
- page.within "#project_member_#{project_member.id}" do
- click_link('Remove user from project')
- end
- end
-
- step 'I share project with group "OpenSource"' do
- project = Project.find_by(name: 'Shop')
- os_group = create(:group, name: 'OpenSource')
- create(:project, group: os_group)
- @os_user1 = create(:user)
- @os_user2 = create(:user)
- os_group.add_owner(@os_user1)
- os_group.add_user(@os_user2, Gitlab::Access::DEVELOPER)
- share_link = project.project_group_links.new(group_access: Gitlab::Access::MASTER)
- share_link.group_id = os_group.id
- share_link.save!
- end
-
- step 'I should see "Opensource" group user listing' do
- page.within '.project-members-groups' do
- expect(page).to have_content('OpenSource')
- expect(first('.group_member')).to have_content('Master')
- end
- end
-end
diff --git a/features/steps/project/wiki.rb b/features/steps/project/wiki.rb
deleted file mode 100644
index 855757e34b3..00000000000
--- a/features/steps/project/wiki.rb
+++ /dev/null
@@ -1,195 +0,0 @@
-class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedNote
- include SharedPaths
-
- step 'I click on the Cancel button' do
- page.within(:css, ".wiki-form .form-actions") do
- click_on "Cancel"
- end
- end
-
- step 'I should be redirected back to the Edit Home Wiki page' do
- expect(current_path).to eq project_wiki_path(project, :home)
- end
-
- step 'I create the Wiki Home page' do
- fill_in "wiki_content", with: '[link test](test)'
- page.within '.wiki-form' do
- click_on "Create page"
- end
- end
-
- step 'I create the Wiki Home page with no content' do
- fill_in "wiki_content", with: ''
- page.within '.wiki-form' do
- click_on "Create page"
- end
- end
-
- step 'I should see the newly created wiki page' do
- expect(page).to have_content "Home"
- expect(page).to have_content "link test"
-
- click_link "link test"
- expect(page).to have_content "Create page"
- end
-
- step 'I have an existing Wiki page' do
- wiki.create_page("existing", "content", :markdown, "first commit")
- @page = wiki.find_page("existing")
- end
-
- step 'I browse to that Wiki page' do
- visit project_wiki_path(project, @page)
- end
-
- step 'I click on the Edit button' do
- click_on "Edit"
- end
-
- step 'I change the content' do
- fill_in "Content", with: 'Updated Wiki Content'
- click_on "Save changes"
- end
-
- step 'I should see the updated content' do
- expect(page).to have_content "Updated Wiki Content"
- end
-
- step 'I should be redirected back to that Wiki page' do
- expect(current_path).to eq project_wiki_path(project, @page)
- end
-
- step 'That page has two revisions' do
- @page.update(content: "new content", message: "second commit")
- end
-
- step 'I click the History button' do
- click_on 'Page history'
- end
-
- step 'I should see both revisions' do
- expect(page).to have_content current_user.name
- expect(page).to have_content "first commit"
- expect(page).to have_content "second commit"
- end
-
- step 'I click on the "Delete this page" button' do
- click_on "Delete"
- end
-
- step 'The page should be deleted' do
- expect(page).to have_content "Page was successfully deleted"
- end
-
- step 'I should see the existing page in the pages list' do
- expect(page).to have_content current_user.name
- expect(find('.wiki-pages')).to have_content @page.title.capitalize
- end
-
- step 'I have an existing Wiki page with images linked on page' do
- wiki.create_page("pictures", "Look at this [image](image.jpg)\n\n ![alt text](image.jpg)", :markdown, "first commit")
- @wiki_page = wiki.find_page("pictures")
- end
-
- step 'I browse to wiki page with images' do
- visit project_wiki_path(project, @wiki_page)
- end
-
- step 'I click on existing image link' do
- file = Gollum::File.new(wiki.wiki)
- Gollum::Wiki.any_instance.stub(:file).with("image.jpg", "master", true).and_return(file)
- Gollum::File.any_instance.stub(:mime_type).and_return("image/jpeg")
- expect(page).to have_link('image', href: "#{wiki.wiki_base_path}/image.jpg")
- click_on "image"
- end
-
- step 'I should see the image from wiki repo' do
- expect(current_path).to match('wikis/image.jpg')
- expect(page).not_to have_xpath('/html') # Page should render the image which means there is no html involved
- Gollum::Wiki.any_instance.unstub(:file)
- Gollum::File.any_instance.unstub(:mime_type)
- end
-
- step 'Image should be shown on the page' do
- expect(page).to have_xpath("//img[@data-src=\"image.jpg\"]")
- end
-
- step 'I click on image link' do
- expect(page).to have_link('image', href: "#{wiki.wiki_base_path}/image.jpg")
- click_on "image"
- end
-
- step 'I should see the new wiki page form' do
- expect(current_path).to match('wikis/image.jpg')
- expect(page).to have_content('New Wiki Page')
- expect(page).to have_content('Create page')
- end
-
- step 'I create a New page with paths' do
- click_on 'New page'
- fill_in 'Page slug', with: 'one/two/three-test'
- page.within '#modal-new-wiki' do
- click_on 'Create page'
- end
- fill_in "wiki_content", with: 'wiki content'
- page.within '.wiki-form' do
- click_on "Create page"
- end
- expect(current_path).to include 'one/two/three-test'
- end
-
- step 'I should see non-escaped link in the pages list' do
- expect(page).to have_xpath("//a[@href='/#{project.full_path}/wikis/one/two/three-test']")
- end
-
- step 'I edit the Wiki page with a path' do
- expect(find('.wiki-pages')).to have_content('Three')
- click_on 'Three'
- expect(find('.nav-text')).to have_content('Three')
- click_on 'Edit'
- end
-
- step 'I should see a non-escaped path' do
- expect(current_path).to include 'one/two/three-test'
- end
-
- step 'I should see the Editing page' do
- expect(page).to have_content('Edit Page')
- end
-
- step 'I view the page history of a Wiki page that has a path' do
- click_on 'Three'
- click_on 'Page history'
- end
-
- step 'I click on Page History' do
- click_on 'Page history'
- end
-
- step 'I should see the page history' do
- page.within(:css, ".nav-text") do
- expect(page).to have_content('History')
- end
- end
-
- step 'I search for Wiki content' do
- fill_in "Search", with: "wiki_content"
- click_button "Search"
- end
-
- step 'I should see a link with a version ID' do
- find('a[href*="?version_id"]')
- end
-
- step 'I should see a "Content can\'t be blank" error message' do
- expect(page).to have_content('The form contains the following error:')
- expect(page).to have_content('Content can\'t be blank')
- end
-
- def wiki
- @project_wiki = ProjectWiki.new(project, current_user)
- end
-end