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/project')
-rw-r--r--features/steps/project/active_tab.rb103
-rw-r--r--features/steps/project/archived.rb37
-rw-r--r--features/steps/project/commits/branches.rb85
-rw-r--r--features/steps/project/commits/comments.rb6
-rw-r--r--features/steps/project/commits/commits.rb103
-rw-r--r--features/steps/project/commits/diff_comments.rb6
-rw-r--r--features/steps/project/commits/tags.rb82
-rw-r--r--features/steps/project/commits/user_lookup.rb48
-rw-r--r--features/steps/project/create.rb42
-rw-r--r--features/steps/project/deploy_keys.rb77
-rw-r--r--features/steps/project/fork.rb34
-rw-r--r--features/steps/project/forked_merge_requests.rb136
-rw-r--r--features/steps/project/graph.rb23
-rw-r--r--features/steps/project/hooks.rb64
-rw-r--r--features/steps/project/issues/filter_labels.rb60
-rw-r--r--features/steps/project/issues/issues.rb276
-rw-r--r--features/steps/project/issues/labels.rb101
-rw-r--r--features/steps/project/issues/milestones.rb59
-rw-r--r--features/steps/project/merge_requests.rb337
-rw-r--r--features/steps/project/network_graph.rb93
-rw-r--r--features/steps/project/project.rb97
-rw-r--r--features/steps/project/project_shortcuts.rb36
-rw-r--r--features/steps/project/redirects.rb69
-rw-r--r--features/steps/project/services.rb225
-rw-r--r--features/steps/project/snippets.rb95
-rw-r--r--features/steps/project/source/browse_files.rb218
-rw-r--r--features/steps/project/source/git_blame.rb19
-rw-r--r--features/steps/project/source/markdown_render.rb288
-rw-r--r--features/steps/project/source/multiselect_blob.rb58
-rw-r--r--features/steps/project/source/search_code.rb19
-rw-r--r--features/steps/project/star.rb37
-rw-r--r--features/steps/project/team_management.rb130
-rw-r--r--features/steps/project/wiki.rb165
33 files changed, 0 insertions, 3228 deletions
diff --git a/features/steps/project/active_tab.rb b/features/steps/project/active_tab.rb
deleted file mode 100644
index dd3215adb1a..00000000000
--- a/features/steps/project/active_tab.rb
+++ /dev/null
@@ -1,103 +0,0 @@
-class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedPaths
- include SharedProject
- include SharedActiveTab
- include SharedProjectTab
-
- # Sub Tabs: Home
-
- step 'I click the "Team" tab' do
- click_link('Members')
- end
-
- step 'I click the "Attachments" tab' do
- click_link('Attachments')
- end
-
- step 'I click the "Snippets" tab' do
- click_link('Snippets')
- end
-
- step 'I click the "Edit" tab' do
- within '.project-settings-nav' do
- click_link('Project')
- end
- end
-
- step 'I click the "Hooks" tab' do
- click_link('Web Hooks')
- end
-
- step 'I click the "Deploy Keys" tab' do
- click_link('Deploy Keys')
- end
-
- step 'the active sub nav should be Team' do
- ensure_active_sub_nav('Members')
- end
-
- step 'the active sub nav should be Edit' do
- ensure_active_sub_nav('Project')
- end
-
- step 'the active sub nav should be Hooks' do
- ensure_active_sub_nav('Web Hooks')
- end
-
- step 'the active sub nav should be Deploy Keys' do
- ensure_active_sub_nav('Deploy Keys')
- end
-
- # Sub Tabs: Commits
-
- step 'I click the "Compare" tab' do
- click_link('Compare')
- end
-
- step 'I click the "Branches" tab' do
- click_link('Branches')
- end
-
- step 'I click the "Tags" tab' do
- click_link('Tags')
- end
-
- step 'the active sub tab should be Commits' do
- ensure_active_sub_tab('Commits')
- end
-
- step 'the active sub tab should be Compare' do
- ensure_active_sub_tab('Compare')
- end
-
- step 'the active sub tab should be Branches' do
- ensure_active_sub_tab('Branches')
- end
-
- step 'the active sub tab should be Tags' do
- ensure_active_sub_tab('Tags')
- end
-
- # Sub Tabs: Issues
-
- step 'I click the "Milestones" tab' do
- click_link('Milestones')
- end
-
- step 'I click the "Labels" tab' do
- click_link('Labels')
- end
-
- step 'the active sub tab should be Issues' do
- ensure_active_sub_tab('Issues')
- end
-
- step 'the active main tab should be Milestones' do
- ensure_active_main_tab('Milestones')
- end
-
- step 'the active main tab should be Labels' do
- ensure_active_main_tab('Labels')
- end
-end
diff --git a/features/steps/project/archived.rb b/features/steps/project/archived.rb
deleted file mode 100644
index 37ad0c77655..00000000000
--- a/features/steps/project/archived.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-class Spinach::Features::ProjectArchived < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
-
- When 'project "Forum" is archived' do
- project = Project.find_by(name: "Forum")
- project.update_attribute(:archived, true)
- end
-
- When 'project "Shop" is archived' do
- project = Project.find_by(name: "Shop")
- project.update_attribute(:archived, true)
- end
-
- When 'I visit project "Forum" page' do
- project = Project.find_by(name: "Forum")
- visit namespace_project_path(project.namespace, project)
- end
-
- step 'I should not see "Archived"' do
- page.should_not have_content "Archived"
- end
-
- step 'I should see "Archived"' do
- page.should have_content "Archived"
- end
-
- When 'I set project archived' do
- click_link "Archive"
- end
-
- When 'I set project unarchived' do
- click_link "Unarchive"
- end
-
-end
diff --git a/features/steps/project/commits/branches.rb b/features/steps/project/commits/branches.rb
deleted file mode 100644
index 07f7e5796a3..00000000000
--- a/features/steps/project/commits/branches.rb
+++ /dev/null
@@ -1,85 +0,0 @@
-class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
-
- step 'I click link "All"' do
- click_link "All"
- end
-
- step 'I should see "Shop" all branches list' do
- page.should have_content "Branches"
- page.should have_content "master"
- end
-
- step 'I click link "Protected"' do
- click_link "Protected"
- end
-
- step 'I should see "Shop" protected branches list' do
- within ".protected-branches-list" do
- page.should have_content "stable"
- page.should_not have_content "master"
- end
- end
-
- step 'project "Shop" has protected branches' do
- project = Project.find_by(name: "Shop")
- project.protected_branches.create(name: "stable")
- end
-
- step 'I click new branch link' do
- click_link "New branch"
- end
-
- step 'I submit new branch form' do
- fill_in 'branch_name', with: 'deploy_keys'
- fill_in 'ref', with: 'master'
- click_button 'Create branch'
- end
-
- step 'I submit new branch form with invalid name' do
- fill_in 'branch_name', with: '1.0 stable'
- fill_in 'ref', with: 'master'
- click_button 'Create branch'
- end
-
- step 'I submit new branch form with invalid reference' do
- fill_in 'branch_name', with: 'foo'
- fill_in 'ref', with: 'foo'
- click_button 'Create branch'
- end
-
- step 'I submit new branch form with branch that already exists' do
- fill_in 'branch_name', with: 'master'
- fill_in 'ref', with: 'master'
- click_button 'Create branch'
- end
-
- step 'I should see new branch created' do
- page.should have_content 'deploy_keys'
- end
-
- step 'I should see new an error that branch is invalid' do
- page.should have_content 'Branch name invalid'
- end
-
- step 'I should see new an error that ref is invalid' do
- page.should have_content 'Invalid reference name'
- end
-
- step 'I should see new an error that branch already exists' do
- page.should have_content 'Branch already exists'
- end
-
- step "I click branch 'improve/awesome' delete link" do
- within '.js-branch-improve\/awesome' do
- find('.btn-remove').click
- sleep 0.05
- end
- end
-
- step "I should not see branch 'improve/awesome'" do
- all(visible: true).should_not have_content 'improve/awesome'
- end
-end
diff --git a/features/steps/project/commits/comments.rb b/features/steps/project/commits/comments.rb
deleted file mode 100644
index 3d4d8ad6368..00000000000
--- a/features/steps/project/commits/comments.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-class Spinach::Features::ProjectCommitsComments < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedNote
- include SharedPaths
- include SharedProject
-end
diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb
deleted file mode 100644
index 57b727f837e..00000000000
--- a/features/steps/project/commits/commits.rb
+++ /dev/null
@@ -1,103 +0,0 @@
-class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
- include RepoHelpers
-
- step 'I see project commits' do
- commit = @project.repository.commit
- page.should have_content(@project.name)
- page.should have_content(commit.message[0..20])
- page.should have_content(commit.short_id)
- end
-
- step 'I click atom feed link' do
- click_link "Feed"
- end
-
- step 'I see commits atom feed' do
- commit = @project.repository.commit
- response_headers['Content-Type'].should have_content("application/atom+xml")
- body.should have_selector("title", text: "Recent commits to #{@project.name}")
- body.should have_selector("author email", text: commit.author_email)
- body.should have_selector("entry summary", text: commit.description[0..10])
- end
-
- step 'I click on commit link' do
- visit namespace_project_commit_path(@project.namespace, @project, sample_commit.id)
- end
-
- step 'I see commit info' do
- page.should have_content sample_commit.message
- page.should have_content "Showing #{sample_commit.files_changed_count} changed files"
- end
-
- step 'I fill compare fields with refs' do
- fill_in "from", with: sample_commit.parent_id
- fill_in "to", with: sample_commit.id
- click_button "Compare"
- end
-
- step 'I unfold diff' do
- @diff = first('.js-unfold')
- @diff.click
- sleep 2
- end
-
- step 'I should see additional file lines' do
- within @diff.parent do
- first('.new_line').text.should_not have_content "..."
- end
- end
-
- step 'I see compared refs' do
- page.should have_content "Compare View"
- page.should have_content "Commits (1)"
- page.should have_content "Showing 2 changed files"
- end
-
- step 'I see breadcrumb links' do
- page.should have_selector('ul.breadcrumb')
- page.should have_selector('ul.breadcrumb a', count: 4)
- end
-
- step 'I see commits stats' do
- page.should have_content 'Top 50 Committers'
- page.should have_content 'Committers'
- page.should have_content 'Total commits'
- page.should have_content 'Authors'
- end
-
- step 'I visit big commit page' do
- Commit::DIFF_SAFE_FILES = 20
- visit namespace_project_commit_path(@project.namespace, @project, sample_big_commit.id)
- end
-
- step 'I see big commit warning' do
- page.should have_content sample_big_commit.message
- page.should have_content "Too many changes"
- Commit::DIFF_SAFE_FILES = 100
- end
-
- step 'I visit a commit with an image that changed' do
- visit namespace_project_commit_path(@project.namespace, @project, sample_image_commit.id)
- end
-
- step 'The diff links to both the previous and current image' do
- links = all('.two-up span div a')
- links[0]['href'].should =~ %r{blob/#{sample_image_commit.old_blob_id}}
- links[1]['href'].should =~ %r{blob/#{sample_image_commit.new_blob_id}}
- end
-
- step 'I click side-by-side diff button' do
- click_link "Side-by-side"
- end
-
- step 'I see side-by-side diff button' do
- page.should have_content "Side-by-side"
- end
-
- step 'I see inline diff button' do
- page.should have_content "Inline"
- end
-end
diff --git a/features/steps/project/commits/diff_comments.rb b/features/steps/project/commits/diff_comments.rb
deleted file mode 100644
index b9d8cf2c5a5..00000000000
--- a/features/steps/project/commits/diff_comments.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-class Spinach::Features::ProjectCommitsDiffComments < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedDiffNote
- include SharedPaths
- include SharedProject
-end
diff --git a/features/steps/project/commits/tags.rb b/features/steps/project/commits/tags.rb
deleted file mode 100644
index 3465fcbfd07..00000000000
--- a/features/steps/project/commits/tags.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-class Spinach::Features::ProjectCommitsTags < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
-
- step 'I should see "Shop" all tags list' do
- page.should have_content "Tags"
- page.should have_content "v1.0.0"
- end
-
- step 'I click new tag link' do
- click_link 'New tag'
- end
-
- step 'I submit new tag form' do
- fill_in 'tag_name', with: 'v7.0'
- fill_in 'ref', with: 'master'
- click_button 'Create tag'
- end
-
- step 'I submit new tag form with invalid name' do
- fill_in 'tag_name', with: 'v 1.0'
- fill_in 'ref', with: 'master'
- click_button 'Create tag'
- end
-
- step 'I submit new tag form with invalid reference' do
- fill_in 'tag_name', with: 'foo'
- fill_in 'ref', with: 'foo'
- click_button 'Create tag'
- end
-
- step 'I submit new tag form with tag that already exists' do
- fill_in 'tag_name', with: 'v1.0.0'
- fill_in 'ref', with: 'master'
- click_button 'Create tag'
- end
-
- step 'I should see new tag created' do
- page.should have_content 'v7.0'
- end
-
- step 'I should see new an error that tag is invalid' do
- page.should have_content 'Tag name invalid'
- end
-
- step 'I should see new an error that tag ref is invalid' do
- page.should have_content 'Invalid reference name'
- end
-
- step 'I should see new an error that tag already exists' do
- page.should have_content 'Tag already exists'
- end
-
- step "I delete tag 'v1.1.0'" do
- within '.tags' do
- first('.btn-remove').click
- sleep 0.05
- end
- end
-
- step "I should not see tag 'v1.1.0'" do
- within '.tags' do
- all(visible: true).should_not have_content 'v1.1.0'
- end
- end
-
- step 'I delete all tags' do
- within '.tags' do
- all('.btn-remove').each do |remove|
- remove.click
- sleep 0.05
- end
- end
- end
-
- step 'I should see tags info message' do
- within '.tags' do
- page.should have_content 'Repository has no tags yet.'
- end
- end
-end
diff --git a/features/steps/project/commits/user_lookup.rb b/features/steps/project/commits/user_lookup.rb
deleted file mode 100644
index 63ff84c82ef..00000000000
--- a/features/steps/project/commits/user_lookup.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-class Spinach::Features::ProjectCommitsUserLookup < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
-
- step 'I click on commit link' do
- visit namespace_project_commit_path(@project.namespace, @project, sample_commit.id)
- end
-
- step 'I click on another commit link' do
- visit namespace_project_commit_path(@project.namespace, @project, sample_commit.parent_id)
- end
-
- step 'I have user with primary email' do
- user_primary
- end
-
- step 'I have user with secondary email' do
- user_secondary
- end
-
- step 'I see author based on primary email' do
- check_author_link(sample_commit.author_email, user_primary)
- end
-
- step 'I see author based on secondary email' do
- check_author_link(sample_commit.author_email, user_secondary)
- end
-
- def check_author_link(email, user)
- author_link = find('.commit-author-link')
- author_link['href'].should == user_path(user)
- author_link['data-original-title'].should == email
- find('.commit-author-name').text.should == user.name
- end
-
- def user_primary
- @user_primary ||= create(:user, email: 'dmitriy.zaporozhets@gmail.com')
- end
-
- def user_secondary
- @user_secondary ||= begin
- user = create(:user, email: 'dzaporozhets@example.com')
- create(:email, { user: user, email: 'dmitriy.zaporozhets@gmail.com' })
- user
- end
- end
-end
diff --git a/features/steps/project/create.rb b/features/steps/project/create.rb
deleted file mode 100644
index 6b85cf74f5f..00000000000
--- a/features/steps/project/create.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-class Spinach::Features::ProjectCreate < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedPaths
-
- step 'fill project form with valid data' do
- fill_in 'project_path', with: 'Empty'
- click_button "Create project"
- end
-
- step 'I should see project page' do
- page.should have_content "Empty"
- current_path.should == namespace_project_path(Project.last.namespace, Project.last)
- end
-
- step 'I should see empty project instuctions' do
- page.should have_content "git init"
- page.should have_content "git remote"
- page.should have_content Project.last.url_to_repo
- end
-
- step 'I see empty project instuctions' do
- page.should have_content "git init"
- page.should have_content "git remote"
- page.should have_content Project.last.url_to_repo
- end
-
- step 'I click on HTTP' do
- click_button 'HTTP'
- end
-
- step 'Remote url should update to http link' do
- page.should have_content "git remote add origin #{Project.last.http_url_to_repo}"
- end
-
- step 'If I click on SSH' do
- click_button 'SSH'
- end
-
- step 'Remote url should update to ssh link' do
- page.should have_content "git remote add origin #{Project.last.url_to_repo}"
- end
-end
diff --git a/features/steps/project/deploy_keys.rb b/features/steps/project/deploy_keys.rb
deleted file mode 100644
index 50e14513a7a..00000000000
--- a/features/steps/project/deploy_keys.rb
+++ /dev/null
@@ -1,77 +0,0 @@
-class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
-
- step 'project has deploy key' do
- create(:deploy_keys_project, project: @project)
- end
-
- step 'I should see project deploy key' do
- within '.enabled-keys' do
- page.should have_content deploy_key.title
- end
- end
-
- step 'I should see other project deploy key' do
- within '.available-keys' do
- page.should have_content other_deploy_key.title
- end
- end
-
- step 'I should see public deploy key' do
- within '.available-keys' do
- page.should have_content public_deploy_key.title
- end
- end
-
- step 'I click \'New Deploy Key\'' do
- click_link 'New Deploy Key'
- end
-
- step 'I submit new deploy key' do
- fill_in "deploy_key_title", with: "laptop"
- fill_in "deploy_key_key", with: "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop"
- click_button "Create"
- end
-
- step 'I should be on deploy keys page' do
- current_path.should == namespace_project_deploy_keys_path(@project.namespace, @project)
- end
-
- step 'I should see newly created deploy key' do
- within '.enabled-keys' do
- page.should have_content(deploy_key.title)
- end
- end
-
- step 'other project has deploy key' do
- @second_project = create :project, namespace: create(:group)
- @second_project.team << [current_user, :master]
- create(:deploy_keys_project, project: @second_project)
- end
-
- step 'public deploy key exists' do
- create(:deploy_key, public: true)
- end
-
- step 'I click attach deploy key' do
- within '.available-keys' do
- click_link 'Enable'
- end
- end
-
- protected
-
- def deploy_key
- @project.deploy_keys.last
- end
-
- def other_deploy_key
- @second_project.deploy_keys.last
- end
-
- def public_deploy_key
- DeployKey.are_public.last
- end
-end
diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb
deleted file mode 100644
index 8e58597db20..00000000000
--- a/features/steps/project/fork.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-class Spinach::Features::ProjectFork < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedPaths
- include SharedProject
-
- step 'I click link "Fork"' do
- page.should have_content "Shop"
- page.should have_content "Fork"
- click_link "Fork"
- end
-
- step 'I am a member of project "Shop"' do
- @project = create(:project, name: "Shop")
- @project.team << [@user, :reporter]
- end
-
- step 'I should see the forked project page' do
- page.should have_content "Project was successfully forked."
- end
-
- step 'I already have a project named "Shop" in my namespace' do
- @my_project = create(:project, name: "Shop", namespace: current_user.namespace)
- end
-
- step 'I should see a "Name has already been taken" warning' do
- page.should have_content "Name has already been taken"
- end
-
- step 'I fork to my namespace' do
- within '.fork-namespaces' do
- click_link current_user.name
- end
- end
-end
diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb
deleted file mode 100644
index 63ad90e1241..00000000000
--- a/features/steps/project/forked_merge_requests.rb
+++ /dev/null
@@ -1,136 +0,0 @@
-class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedNote
- include SharedPaths
- include Select2Helper
-
- step 'I am a member of project "Shop"' do
- @project = Project.find_by(name: "Shop")
- @project ||= create(:project, name: "Shop")
- @project.team << [@user, :reporter]
- @project.ensure_satellite_exists
- end
-
- step 'I have a project forked off of "Shop" called "Forked Shop"' do
- @forked_project = Projects::ForkService.new(@project, @user).execute
- end
-
- step 'I click link "New Merge Request"' do
- click_link "New Merge Request"
- end
-
- step 'I should see merge request "Merge Request On Forked Project"' do
- @project.merge_requests.size.should >= 1
- @merge_request = @project.merge_requests.last
- current_path.should == namespace_project_merge_request_path(@project.namespace, @project, @merge_request)
- @merge_request.title.should == "Merge Request On Forked Project"
- @merge_request.source_project.should == @forked_project
- @merge_request.source_branch.should == "fix"
- @merge_request.target_branch.should == "master"
- page.should have_content @forked_project.path_with_namespace
- page.should have_content @project.path_with_namespace
- page.should have_content @merge_request.source_branch
- page.should have_content @merge_request.target_branch
- end
-
- step 'I fill out a "Merge Request On Forked Project" merge request' do
- select @forked_project.path_with_namespace, from: "merge_request_source_project_id"
- select @project.path_with_namespace, from: "merge_request_target_project_id"
- select "fix", from: "merge_request_source_branch"
- select "master", from: "merge_request_target_branch"
-
- click_button "Compare branches"
-
- fill_in "merge_request_title", with: "Merge Request On Forked Project"
- end
-
- step 'I submit the merge request' do
- click_button "Submit merge request"
- end
-
- step 'I follow the target commit link' do
- commit = @project.repository.commit
- click_link commit.short_id(8)
- end
-
- step 'I should see the commit under the forked from project' do
- commit = @project.repository.commit
- page.should have_content(commit.message)
- end
-
- step 'I click "Create Merge Request on fork" link' do
- click_link "Create Merge Request on fork"
- end
-
- step 'I see prefilled new Merge Request page for the forked project' do
- current_path.should == new_namespace_project_merge_request_path(@forked_project.namespace, @forked_project)
- find("#merge_request_source_project_id").value.should == @forked_project.id.to_s
- find("#merge_request_target_project_id").value.should == @project.id.to_s
- find("#merge_request_source_branch").value.should have_content "new_design"
- find("#merge_request_target_branch").value.should have_content "master"
- find("#merge_request_title").value.should == "New Design"
- verify_commit_link(".mr_target_commit", @project)
- verify_commit_link(".mr_source_commit", @forked_project)
- end
-
- step 'I update the merge request title' do
- fill_in "merge_request_title", with: "An Edited Forked Merge Request"
- end
-
- step 'I save the merge request' do
- click_button "Save changes"
- end
-
- step 'I should see the edited merge request' do
- page.should have_content "An Edited Forked Merge Request"
- @project.merge_requests.size.should >= 1
- @merge_request = @project.merge_requests.last
- current_path.should == namespace_project_merge_request_path(@project.namespace, @project, @merge_request)
- @merge_request.source_project.should == @forked_project
- @merge_request.source_branch.should == "fix"
- @merge_request.target_branch.should == "master"
- page.should have_content @forked_project.path_with_namespace
- page.should have_content @project.path_with_namespace
- page.should have_content @merge_request.source_branch
- page.should have_content @merge_request.target_branch
- end
-
- step 'I should see last push widget' do
- page.should have_content "You pushed to new_design"
- page.should have_link "Create Merge Request"
- end
-
- step 'I click link edit "Merge Request On Forked Project"' do
- find("#edit_merge_request").click
- end
-
- step 'I see the edit page prefilled for "Merge Request On Forked Project"' do
- current_path.should == edit_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)
- page.should have_content "Edit merge request ##{@merge_request.id}"
- find("#merge_request_title").value.should == "Merge Request On Forked Project"
- end
-
- step 'I fill out an invalid "Merge Request On Forked Project" merge request' do
- select "Select branch", from: "merge_request_target_branch"
- find(:select, "merge_request_source_project_id", {}).value.should == @forked_project.id.to_s
- find(:select, "merge_request_target_project_id", {}).value.should == @project.id.to_s
- find(:select, "merge_request_source_branch", {}).value.should == ""
- find(:select, "merge_request_target_branch", {}).value.should == ""
- click_button "Compare branches"
- end
-
- step 'I should see validation errors' do
- page.should have_content "You must select source and target branch"
- end
-
- step 'the target repository should be the original repository' do
- page.should have_select("merge_request_target_project_id", selected: @project.path_with_namespace)
- end
-
- # Verify a link is generated against the correct project
- def verify_commit_link(container_div, container_project)
- # This should force a wait for the javascript to execute
- find(:div,container_div).find(".commit_short_id")['href'].should have_content "#{container_project.path_with_namespace}/commit"
- end
-end
diff --git a/features/steps/project/graph.rb b/features/steps/project/graph.rb
deleted file mode 100644
index a2807c340f6..00000000000
--- a/features/steps/project/graph.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-class Spinach::Features::ProjectGraph < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
-
- step 'page should have graphs' do
- page.should have_selector ".stat-graph"
- end
-
- When 'I visit project "Shop" graph page' do
- project = Project.find_by(name: "Shop")
- visit namespace_project_graph_path(project.namespace, project, "master")
- end
-
- step 'I visit project "Shop" commits graph page' do
- project = Project.find_by(name: "Shop")
- visit commits_namespace_project_graph_path(project.namespace, project, "master")
- end
-
- step 'page should have commits graphs' do
- page.should have_content "Commit statistics for master"
- page.should have_content "Commits per day of month"
- end
-end
diff --git a/features/steps/project/hooks.rb b/features/steps/project/hooks.rb
deleted file mode 100644
index 4b135202593..00000000000
--- a/features/steps/project/hooks.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-require 'webmock'
-
-class Spinach::Features::ProjectHooks < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
- include RSpec::Matchers
- include RSpec::Mocks::ExampleMethods
- include WebMock::API
-
- step 'project has hook' do
- @hook = create(:project_hook, project: current_project)
- end
-
- step 'I own empty project with hook' do
- @project = create(:empty_project,
- name: 'Empty Project', namespace: @user.namespace)
- @hook = create(:project_hook, project: current_project)
- end
-
- step 'I should see project hook' do
- page.should have_content @hook.url
- end
-
- step 'I submit new hook' do
- @url = Faker::Internet.uri("http")
- fill_in "hook_url", with: @url
- expect { click_button "Add Web Hook" }.to change(ProjectHook, :count).by(1)
- end
-
- step 'I should see newly created hook' do
- current_path.should == namespace_project_hooks_path(current_project.namespace, current_project)
- page.should have_content(@url)
- end
-
- step 'I click test hook button' do
- stub_request(:post, @hook.url).to_return(status: 200)
- click_link 'Test Hook'
- end
-
- step 'I click test hook button with invalid URL' do
- stub_request(:post, @hook.url).to_raise(SocketError)
- click_link 'Test Hook'
- end
-
- step 'hook should be triggered' do
- current_path.should == namespace_project_hooks_path(current_project.namespace, current_project)
- page.should have_selector '.flash-notice',
- text: 'Hook successfully executed.'
- end
-
- step 'I should see hook error message' do
- page.should have_selector '.flash-alert',
- text: 'Hook execution failed. '\
- 'Ensure the project has commits.'
- end
-
- step 'I should see hook service down error message' do
- page.should have_selector '.flash-alert',
- text: 'Hook execution failed. '\
- 'Ensure hook URL is correct and '\
- 'service is up.'
- end
-end
diff --git a/features/steps/project/issues/filter_labels.rb b/features/steps/project/issues/filter_labels.rb
deleted file mode 100644
index 5740bd12837..00000000000
--- a/features/steps/project/issues/filter_labels.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-class Spinach::Features::ProjectIssuesFilterLabels < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
- include Select2Helper
-
- step 'I should see "Bugfix1" in issues list' do
- within ".issues-list" do
- page.should have_content "Bugfix1"
- end
- end
-
- step 'I should see "Bugfix2" in issues list' do
- within ".issues-list" do
- page.should have_content "Bugfix2"
- end
- end
-
- step 'I should not see "Bugfix2" in issues list' do
- within ".issues-list" do
- page.should_not have_content "Bugfix2"
- end
- end
-
- step 'I should not see "Feature1" in issues list' do
- within ".issues-list" do
- page.should_not have_content "Feature1"
- end
- end
-
- step 'I click link "bug"' do
- select2('bug', from: "#label_name")
- end
-
- step 'I click link "feature"' do
- within ".labels-filter" do
- click_link "feature"
- end
- end
-
- step 'project "Shop" has issue "Bugfix1" with labels: "bug", "feature"' do
- project = Project.find_by(name: "Shop")
- issue = create(:issue, title: "Bugfix1", project: project)
- issue.labels << project.labels.find_by(title: 'bug')
- issue.labels << project.labels.find_by(title: 'feature')
- end
-
- step 'project "Shop" has issue "Bugfix2" with labels: "bug", "enhancement"' do
- project = Project.find_by(name: "Shop")
- issue = create(:issue, title: "Bugfix2", project: project)
- issue.labels << project.labels.find_by(title: 'bug')
- issue.labels << project.labels.find_by(title: 'enhancement')
- end
-
- step 'project "Shop" has issue "Feature1" with labels: "feature"' do
- project = Project.find_by(name: "Shop")
- issue = create(:issue, title: "Feature1", project: project)
- issue.labels << project.labels.find_by(title: 'feature')
- end
-end
diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb
deleted file mode 100644
index b8e282b2029..00000000000
--- a/features/steps/project/issues/issues.rb
+++ /dev/null
@@ -1,276 +0,0 @@
-class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedIssuable
- include SharedProject
- include SharedNote
- include SharedPaths
- include SharedMarkdown
-
- step 'I should see "Release 0.4" in issues' do
- page.should have_content "Release 0.4"
- end
-
- step 'I should not see "Release 0.3" in issues' do
- page.should_not have_content "Release 0.3"
- end
-
- step 'I should not see "Tweet control" in issues' do
- page.should_not have_content "Tweet control"
- end
-
- step 'I should see that I am subscribed' do
- find(".subscribe-button span").text.should == "Unsubscribe"
- end
-
- step 'I should see that I am unsubscribed' do
- sleep 0.2
- find(".subscribe-button span").text.should == "Subscribe"
- end
-
- step 'I click link "Closed"' do
- click_link "Closed"
- end
-
- step 'I click button "Unsubscribe"' do
- click_on "Unsubscribe"
- end
-
- step 'I should see "Release 0.3" in issues' do
- page.should have_content "Release 0.3"
- end
-
- step 'I should not see "Release 0.4" in issues' do
- page.should_not have_content "Release 0.4"
- end
-
- step 'I click link "All"' do
- click_link "All"
- end
-
- step 'I click link "Release 0.4"' do
- click_link "Release 0.4"
- end
-
- step 'I should see issue "Release 0.4"' do
- page.should have_content "Release 0.4"
- end
-
- step 'I click link "New Issue"' do
- click_link "New Issue"
- end
-
- step 'I click "author" dropdown' do
- first('.ajax-users-select').click
- end
-
- step 'I see current user as the first user' do
- expect(page).to have_selector('.user-result', visible: true, count: 4)
- users = page.all('.user-name')
- users[0].text.should == 'Any'
- users[1].text.should == 'Unassigned'
- users[2].text.should == current_user.name
- end
-
- step 'I submit new issue "500 error on profile"' do
- fill_in "issue_title", with: "500 error on profile"
- click_button "Submit new issue"
- end
-
- step 'I submit new issue "500 error on profile" with label \'bug\'' do
- fill_in "issue_title", with: "500 error on profile"
- select 'bug', from: "Labels"
- click_button "Submit new issue"
- end
-
- step 'I click link "500 error on profile"' do
- click_link "500 error on profile"
- end
-
- step 'I should see label \'bug\' with issue' do
- within '.issue-show-labels' do
- page.should have_content 'bug'
- end
- end
-
- step 'I should see issue "500 error on profile"' do
- issue = Issue.find_by(title: "500 error on profile")
- page.should have_content issue.title
- page.should have_content issue.author_name
- page.should have_content issue.project.name
- end
-
- step 'I fill in issue search with "Re"' do
- filter_issue "Re"
- end
-
- step 'I fill in issue search with "Bu"' do
- filter_issue "Bu"
- end
-
- step 'I fill in issue search with ".3"' do
- filter_issue ".3"
- end
-
- step 'I fill in issue search with "Something"' do
- filter_issue "Something"
- end
-
- step 'I fill in issue search with ""' do
- filter_issue ""
- end
-
- step 'project "Shop" has milestone "v2.2"' do
-
- milestone = create(:milestone, title: "v2.2", project: project)
-
- 3.times { create(:issue, project: project, milestone: milestone) }
- end
-
- step 'project "Shop" has milestone "v3.0"' do
-
- milestone = create(:milestone, title: "v3.0", project: project)
-
- 3.times { create(:issue, project: project, milestone: milestone) }
- end
-
- When 'I select milestone "v3.0"' do
- select "v3.0", from: "milestone_id"
- end
-
- step 'I should see selected milestone with title "v3.0"' do
- issues_milestone_selector = "#issue_milestone_id_chzn > a"
- find(issues_milestone_selector).should have_content("v3.0")
- end
-
- When 'I select first assignee from "Shop" project' do
-
- first_assignee = project.users.first
- select first_assignee.name, from: "assignee_id"
- end
-
- step 'I should see first assignee from "Shop" as selected assignee' do
- issues_assignee_selector = "#issue_assignee_id_chzn > a"
-
- assignee_name = project.users.first.name
- find(issues_assignee_selector).should have_content(assignee_name)
- end
-
- step 'project "Shop" have "Release 0.4" open issue' do
-
- create(:issue,
- title: "Release 0.4",
- project: project,
- author: project.users.first,
- description: "# Description header"
- )
- end
-
- step 'project "Shop" have "Tweet control" open issue' do
- create(:issue,
- title: "Tweet control",
- project: project,
- author: project.users.first)
- end
-
- step 'project "Shop" have "Release 0.3" closed issue' do
- create(:closed_issue,
- title: "Release 0.3",
- project: project,
- author: project.users.first)
- end
-
- step 'project "Shop" has "Tasks-open" open issue with task markdown' do
- create_taskable(:issue, 'Tasks-open')
- end
-
- step 'project "Shop" has "Tasks-closed" closed issue with task markdown' do
- create_taskable(:closed_issue, 'Tasks-closed')
- end
-
- step 'empty project "Empty Project"' do
- create :empty_project, name: 'Empty Project', namespace: @user.namespace
- end
-
- When 'I visit empty project page' do
- project = Project.find_by(name: 'Empty Project')
- visit namespace_project_path(project.namespace, project)
- end
-
- step 'I see empty project details with ssh clone info' do
- project = Project.find_by(name: 'Empty Project')
- all(:css, '.git-empty .clone').each do |element|
- element.text.should include(project.url_to_repo)
- end
- end
-
- When "I visit empty project's issues page" do
- project = Project.find_by(name: 'Empty Project')
- visit namespace_project_issues_path(project.namespace, project)
- end
-
- step 'I leave a comment with code block' do
- within(".js-main-target-form") do
- fill_in "note[note]", with: "```\nCommand [1]: /usr/local/bin/git , see [text](doc/text)\n```"
- click_button "Add Comment"
- sleep 0.05
- end
- end
-
- step 'I should see an error alert section within the comment form' do
- within(".js-main-target-form") do
- find(".error-alert")
- end
- end
-
- step 'The code block should be unchanged' do
- page.should have_content("```\nCommand [1]: /usr/local/bin/git , see [text](doc/text)\n```")
- end
-
- step 'project \'Shop\' has issue \'Bugfix1\' with description: \'Description for issue1\'' do
- issue = create(:issue, title: 'Bugfix1', description: 'Description for issue1', project: project)
- end
-
- step 'project \'Shop\' has issue \'Feature1\' with description: \'Feature submitted for issue1\'' do
- issue = create(:issue, title: 'Feature1', description: 'Feature submitted for issue1', project: project)
- end
-
- step 'I fill in issue search with \'Description for issue1\'' do
- filter_issue 'Description for issue'
- end
-
- step 'I fill in issue search with \'issue1\'' do
- filter_issue 'issue1'
- end
-
- step 'I fill in issue search with \'Rock and roll\'' do
- filter_issue 'Description for issue'
- end
-
- step 'I should see \'Bugfix1\' in issues' do
- page.should have_content 'Bugfix1'
- end
-
- step 'I should see \'Feature1\' in issues' do
- page.should have_content 'Feature1'
- end
-
- step 'I should not see \'Bugfix1\' in issues' do
- page.should_not have_content 'Bugfix1'
- end
-
- step 'issue \'Release 0.4\' has label \'bug\'' do
- label = project.labels.create!(name: 'bug', color: '#990000')
- issue = Issue.find_by!(title: 'Release 0.4')
- issue.labels << label
- end
-
- step 'I click label \'bug\'' do
- within ".issues-list" do
- click_link 'bug'
- end
- end
-
- def filter_issue(text)
- fill_in 'issue_search', with: text
- end
-end
diff --git a/features/steps/project/issues/labels.rb b/features/steps/project/issues/labels.rb
deleted file mode 100644
index 6ce34c500c6..00000000000
--- a/features/steps/project/issues/labels.rb
+++ /dev/null
@@ -1,101 +0,0 @@
-class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
-
- step 'I visit \'bug\' label edit page' do
- visit edit_namespace_project_label_path(project.namespace, project, bug_label)
- end
-
- step 'I remove label \'bug\'' do
- within "#label_#{bug_label.id}" do
- click_link 'Remove'
- end
- end
-
- step 'I delete all labels' do
- within '.labels' do
- all('.btn-remove').each do |remove|
- remove.click
- sleep 0.05
- end
- end
- end
-
- step 'I should see labels help message' do
- within '.labels' do
- page.should have_content 'Create first label or generate default set of '\
- 'labels'
- end
- end
-
- step 'I submit new label \'support\'' do
- fill_in 'Title', with: 'support'
- fill_in 'Background Color', with: '#F95610'
- click_button 'Save'
- end
-
- step 'I submit new label \'bug\'' do
- fill_in 'Title', with: 'bug'
- fill_in 'Background Color', with: '#F95610'
- click_button 'Save'
- end
-
- step 'I submit new label with invalid color' do
- fill_in 'Title', with: 'support'
- fill_in 'Background Color', with: '#12'
- click_button 'Save'
- end
-
- step 'I should see label label exist error message' do
- within '.label-form' do
- page.should have_content 'Title has already been taken'
- end
- end
-
- step 'I should see label color error message' do
- within '.label-form' do
- page.should have_content 'Color is invalid'
- end
- end
-
- step 'I should see label \'feature\'' do
- within '.manage-labels-list' do
- page.should have_content 'feature'
- end
- end
-
- step 'I should see label \'bug\'' do
- within '.manage-labels-list' do
- page.should have_content 'bug'
- end
- end
-
- step 'I should not see label \'bug\'' do
- within '.manage-labels-list' do
- page.should_not have_content 'bug'
- end
- end
-
- step 'I should see label \'support\'' do
- within '.manage-labels-list' do
- page.should have_content 'support'
- end
- end
-
- step 'I change label \'bug\' to \'fix\'' do
- fill_in 'Title', with: 'fix'
- fill_in 'Background Color', with: '#F15610'
- click_button 'Save'
- end
-
- step 'I should see label \'fix\'' do
- within '.manage-labels-list' do
- page.should have_content 'fix'
- end
- end
-
- def bug_label
- project.labels.find_or_create_by(title: 'bug')
- end
-end
diff --git a/features/steps/project/issues/milestones.rb b/features/steps/project/issues/milestones.rb
deleted file mode 100644
index cce87a6d981..00000000000
--- a/features/steps/project/issues/milestones.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
- include SharedMarkdown
-
- step 'I should see milestone "v2.2"' do
- milestone = @project.milestones.find_by(title: "v2.2")
- page.should have_content(milestone.title[0..10])
- page.should have_content(milestone.expires_at)
- page.should have_content("Issues")
- end
-
- step 'I click link "v2.2"' do
- click_link "v2.2"
- end
-
- step 'I click link "New Milestone"' do
- click_link "New Milestone"
- end
-
- step 'I submit new milestone "v2.3"' do
- fill_in "milestone_title", with: "v2.3"
- click_button "Create milestone"
- end
-
- step 'I should see milestone "v2.3"' do
- milestone = @project.milestones.find_by(title: "v2.3")
- page.should have_content(milestone.title[0..10])
- page.should have_content(milestone.expires_at)
- page.should have_content("Issues")
- end
-
- step 'project "Shop" has milestone "v2.2"' do
- project = Project.find_by(name: "Shop")
- milestone = create(:milestone,
- title: "v2.2",
- project: project,
- description: "# Description header"
- )
- 3.times { create(:issue, project: project, milestone: milestone) }
- end
-
- step 'the milestone has open and closed issues' do
- project = Project.find_by(name: "Shop")
- milestone = project.milestones.find_by(title: 'v2.2')
-
- # 3 Open issues created above; create one closed issue
- create(:closed_issue, project: project, milestone: milestone)
- end
-
- When 'I click link "All Issues"' do
- click_link 'All Issues'
- end
-
- step 'I should see 3 issues' do
- page.should have_selector('#tab-issues li.issue-row', count: 4)
- end
-end
diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb
deleted file mode 100644
index bb1f9f129c0..00000000000
--- a/features/steps/project/merge_requests.rb
+++ /dev/null
@@ -1,337 +0,0 @@
-class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedIssuable
- include SharedProject
- include SharedNote
- include SharedPaths
- include SharedMarkdown
- include SharedDiffNote
-
- step 'I click link "New Merge Request"' do
- click_link "New Merge Request"
- end
-
- step 'I click link "Bug NS-04"' do
- click_link "Bug NS-04"
- end
-
- step 'I click link "All"' do
- click_link "All"
- end
-
- step 'I click link "Closed"' do
- click_link "Closed"
- end
-
- step 'I should see merge request "Wiki Feature"' do
- within '.merge-request' do
- page.should have_content "Wiki Feature"
- end
- end
-
- step 'I should see closed merge request "Bug NS-04"' do
- merge_request = MergeRequest.find_by!(title: "Bug NS-04")
- merge_request.closed?.should be_true
- page.should have_content "Closed by"
- end
-
- step 'I should see merge request "Bug NS-04"' do
- page.should have_content "Bug NS-04"
- end
-
- step 'I should see "Bug NS-04" in merge requests' do
- page.should have_content "Bug NS-04"
- end
-
- step 'I should see "Feature NS-03" in merge requests' do
- page.should have_content "Feature NS-03"
- end
-
- step 'I should not see "Feature NS-03" in merge requests' do
- page.should_not have_content "Feature NS-03"
- end
-
-
- step 'I should not see "Bug NS-04" in merge requests' do
- page.should_not have_content "Bug NS-04"
- end
-
- step 'I should see that I am subscribed' do
- find(".subscribe-button span").text.should == "Unsubscribe"
- end
-
- step 'I should see that I am unsubscribed' do
- find(".subscribe-button span").should have_content("Subscribe")
- end
-
- step 'I click button "Unsubscribe"' do
- click_on "Unsubscribe"
- end
-
- step 'I click link "Close"' do
- first(:css, '.close-mr-link').click
- end
-
- step 'I submit new merge request "Wiki Feature"' do
- select "fix", from: "merge_request_source_branch"
- select "feature", from: "merge_request_target_branch"
- click_button "Compare branches"
- fill_in "merge_request_title", with: "Wiki Feature"
- click_button "Submit merge request"
- end
-
- step 'project "Shop" have "Bug NS-04" open merge request' do
- create(:merge_request,
- title: "Bug NS-04",
- source_project: project,
- target_project: project,
- source_branch: 'fix',
- target_branch: 'master',
- author: project.users.first,
- description: "# Description header"
- )
- end
-
- step 'project "Shop" have "Bug NS-05" open merge request with diffs inside' do
- create(:merge_request_with_diffs,
- title: "Bug NS-05",
- source_project: project,
- target_project: project,
- author: project.users.first)
- end
-
- step 'project "Shop" have "Feature NS-03" closed merge request' do
- create(:closed_merge_request,
- title: "Feature NS-03",
- source_project: project,
- target_project: project,
- author: project.users.first)
- end
-
- step 'project "Shop" has "MR-task-open" open MR with task markdown' do
- create_taskable(:merge_request, 'MR-task-open')
- end
-
- step 'I switch to the diff tab' do
- visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request)
- end
-
- step 'I click on the Changes tab via Javascript' do
- find('.diffs-tab').click
- sleep 2
- end
-
- step 'I should see the proper Inline and Side-by-side links' do
- buttons = all('#commit-diff-viewtype')
- expect(buttons.count).to eq(2)
-
- buttons.each do |b|
- expect(b['href']).should_not have_content('json')
- end
- end
-
- step 'I switch to the merge request\'s comments tab' do
- visit namespace_project_merge_request_path(project.namespace, project, merge_request)
- end
-
- step 'I click on the commit in the merge request' do
- within '.merge-request-tabs' do
- click_link 'Commits'
- end
-
- within '.commits' do
- click_link Commit.truncate_sha(sample_commit.id)
- end
- end
-
- step 'I leave a comment on the diff page' do
- init_diff_note
- leave_comment "One comment to rule them all"
- end
-
- step 'I leave a comment on the diff page in commit' do
- click_diff_line(sample_commit.line_code)
- leave_comment "One comment to rule them all"
- end
-
- step 'I leave a comment like "Line is wrong" on diff' do
- init_diff_note
- leave_comment "Line is wrong"
- end
-
- step 'I leave a comment like "Line is wrong" on diff in commit' do
- click_diff_line(sample_commit.line_code)
- leave_comment "Line is wrong"
- end
-
- step 'I should see a discussion has started on diff' do
- page.should have_content "#{current_user.name} started a discussion"
- page.should have_content sample_commit.line_code_path
- page.should have_content "Line is wrong"
- end
-
- step 'I should see a discussion has started on commit diff' do
- page.should have_content "#{current_user.name} started a discussion on commit"
- page.should have_content sample_commit.line_code_path
- page.should have_content "Line is wrong"
- end
-
- step 'I should see a discussion has started on commit' do
- page.should have_content "#{current_user.name} started a discussion on commit"
- page.should have_content "One comment to rule them all"
- end
-
- step 'merge request is mergeable' do
- page.should have_button 'Accept Merge Request'
- end
-
- step 'I modify merge commit message' do
- find('.modify-merge-commit-link').click
- fill_in 'commit_message', with: 'wow such merge'
- end
-
- step 'merge request "Bug NS-05" is mergeable' do
- merge_request.mark_as_mergeable
- end
-
- step 'I accept this merge request' do
- Gitlab::Satellite::MergeAction.any_instance.stub(
- merge!: true,
- )
-
- within '.can_be_merged' do
- click_button "Accept Merge Request"
- end
- end
-
- step 'I should see merged request' do
- within '.issue-box' do
- page.should have_content "Merged"
- end
- end
-
- step 'I click link "Reopen"' do
- first(:css, '.reopen-mr-link').click
- end
-
- step 'I should see reopened merge request "Bug NS-04"' do
- within '.issue-box' do
- page.should have_content "Open"
- end
- end
-
- step 'I click link "Hide inline discussion" of the second file' do
- within '.files [id^=diff]:nth-child(2)' do
- find('.js-toggle-diff-comments').click
- end
- end
-
- step 'I click link "Show inline discussion" of the second file' do
- within '.files [id^=diff]:nth-child(2)' do
- find('.js-toggle-diff-comments').click
- end
- end
-
- step 'I should not see a comment like "Line is wrong" in the second file' do
- within '.files [id^=diff]:nth-child(2)' do
- page.should_not have_visible_content "Line is wrong"
- end
- end
-
- step 'I should see a comment like "Line is wrong" in the second file' do
- within '.files [id^=diff]:nth-child(2) .note-body > .note-text' do
- page.should have_visible_content "Line is wrong"
- end
- end
-
- step 'I should not see a comment like "Line is wrong here" in the second file' do
- within '.files [id^=diff]:nth-child(2)' do
- page.should_not have_visible_content "Line is wrong here"
- end
- end
-
- step 'I should see a comment like "Line is wrong here" in the second file' do
- within '.files [id^=diff]:nth-child(2) .note-body > .note-text' do
- page.should have_visible_content "Line is wrong here"
- end
- end
-
- step 'I leave a comment like "Line is correct" on line 12 of the first file' do
- init_diff_note_first_file
-
- within(".js-discussion-note-form") do
- fill_in "note_note", with: "Line is correct"
- click_button "Add Comment"
- end
-
- within ".files [id^=diff]:nth-child(1) .note-body > .note-text" do
- page.should have_content "Line is correct"
- end
- end
-
- step 'I leave a comment like "Line is wrong" on line 39 of the second file' do
- init_diff_note_second_file
-
- within(".js-discussion-note-form") do
- fill_in "note_note", with: "Line is wrong on here"
- click_button "Add Comment"
- end
- end
-
- step 'I should still see a comment like "Line is correct" in the first file' do
- within '.files [id^=diff]:nth-child(1) .note-body > .note-text' do
- page.should have_visible_content "Line is correct"
- end
- end
-
- step 'I unfold diff' do
- first('.js-unfold').click
- end
-
- step 'I should see additional file lines' do
- expect(first('.text-file')).to have_content('.bundle')
- end
-
- step 'I click Side-by-side Diff tab' do
- find('a', text: 'Side-by-side').trigger('click')
- end
-
- step 'I should see comments on the side-by-side diff page' do
- within '.files [id^=diff]:nth-child(1) .parallel .note-body > .note-text' do
- page.should have_visible_content "Line is correct"
- end
- end
-
- step 'I fill in merge request search with "Fe"' do
- fill_in 'issue_search', with: "Fe"
- end
-
- def merge_request
- @merge_request ||= MergeRequest.find_by!(title: "Bug NS-05")
- end
-
- def init_diff_note
- click_diff_line(sample_commit.line_code)
- end
-
- def leave_comment(message)
- within(".js-discussion-note-form") do
- fill_in "note_note", with: message
- click_button "Add Comment"
- end
-
- page.should have_content message
- end
-
- def init_diff_note_first_file
- click_diff_line(sample_compare.changes[0][:line_code])
- end
-
- def init_diff_note_second_file
- click_diff_line(sample_compare.changes[1][:line_code])
- end
-
- def have_visible_content (text)
- have_css("*", text: text, visible: true)
- end
-end
diff --git a/features/steps/project/network_graph.rb b/features/steps/project/network_graph.rb
deleted file mode 100644
index a15688ace6a..00000000000
--- a/features/steps/project/network_graph.rb
+++ /dev/null
@@ -1,93 +0,0 @@
-class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedPaths
- include SharedProject
-
- step 'page should have network graph' do
- page.should have_selector ".network-graph"
- end
-
- When 'I visit project "Shop" network page' do
- # Stub Graph max_size to speed up test (10 commits vs. 650)
- Network::Graph.stub(max_count: 10)
-
- project = Project.find_by(name: "Shop")
- visit namespace_project_network_path(project.namespace, project, "master")
- end
-
- step 'page should select "master" in select box' do
- page.should have_selector '.select2-chosen', text: "master"
- end
-
- step 'page should select "v1.0.0" in select box' do
- page.should have_selector '.select2-chosen', text: "v1.0.0"
- end
-
- step 'page should have "master" on graph' do
- within '.network-graph' do
- page.should have_content 'master'
- end
- end
-
- When 'I switch ref to "feature"' do
- select 'feature', from: 'ref'
- sleep 2
- end
-
- When 'I switch ref to "v1.0.0"' do
- select 'v1.0.0', from: 'ref'
- sleep 2
- end
-
- When 'click "Show only selected branch" checkbox' do
- find('#filter_ref').click
- sleep 2
- end
-
- step 'page should have content not containing "v1.0.0"' do
- within '.network-graph' do
- page.should have_content 'Change some files'
- end
- end
-
- step 'page should not have content not containing "v1.0.0"' do
- within '.network-graph' do
- page.should_not have_content 'Change some files'
- end
- end
-
- step 'page should select "feature" in select box' do
- page.should have_selector '.select2-chosen', text: "feature"
- end
-
- step 'page should select "v1.0.0" in select box' do
- page.should have_selector '.select2-chosen', text: "v1.0.0"
- end
-
- step 'page should have "feature" on graph' do
- within '.network-graph' do
- page.should have_content 'feature'
- end
- end
-
- When 'I looking for a commit by SHA of "v1.0.0"' do
- within ".network-form" do
- fill_in 'extended_sha1', with: '6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9'
- find('button').click
- end
- sleep 2
- end
-
- step 'page should have "v1.0.0" on graph' do
- within '.network-graph' do
- page.should have_content 'v1.0.0'
- end
- end
-
- When 'I look for a commit by ";"' do
- within ".network-form" do
- fill_in 'extended_sha1', with: ';'
- find('button').click
- end
- end
-end
diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb
deleted file mode 100644
index d39c8e7d2db..00000000000
--- a/features/steps/project/project.rb
+++ /dev/null
@@ -1,97 +0,0 @@
-class Spinach::Features::Project < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
-
- step 'change project settings' do
- fill_in 'project_name_edit', with: 'NewName'
- uncheck 'project_issues_enabled'
- end
-
- step 'I save project' do
- click_button 'Save changes'
- end
-
- step 'I should see project with new settings' do
- find_field('project_name').value.should == 'NewName'
- end
-
- step 'change project path settings' do
- fill_in 'project_path', with: 'new-path'
- click_button 'Rename'
- end
-
- step 'I should see project with new path settings' do
- project.path.should == 'new-path'
- end
-
- step 'I change the project avatar' do
- attach_file(
- :project_avatar,
- File.join(Rails.root, 'public', 'gitlab_logo.png')
- )
- click_button 'Save changes'
- @project.reload
- end
-
- step 'I should see new project avatar' do
- @project.avatar.should be_instance_of AvatarUploader
- url = @project.avatar.url
- url.should == "/uploads/project/avatar/#{ @project.id }/gitlab_logo.png"
- end
-
- step 'I should see the "Remove avatar" button' do
- page.should have_link('Remove avatar')
- end
-
- step 'I have an project avatar' do
- attach_file(
- :project_avatar,
- File.join(Rails.root, 'public', 'gitlab_logo.png')
- )
- click_button 'Save changes'
- @project.reload
- end
-
- step 'I remove my project avatar' do
- click_link 'Remove avatar'
- @project.reload
- end
-
- step 'I should see the default project avatar' do
- @project.avatar?.should be_false
- end
-
- step 'I should not see the "Remove avatar" button' do
- page.should_not have_link('Remove avatar')
- end
-
- step 'I should see project "Shop" version' do
- within '.project-side' do
- page.should have_content 'Version: 6.7.0.pre'
- end
- end
-
- step 'change project default branch' do
- select 'fix', from: 'project_default_branch'
- click_button 'Save changes'
- end
-
- step 'I should see project default branch changed' do
- find(:css, 'select#project_default_branch').value.should == 'fix'
- end
-
- step 'I select project "Forum" README tab' do
- click_link 'Readme'
- end
-
- step 'I should see project "Forum" README' do
- page.should have_link 'README.md'
- page.should have_content 'Sample repo for testing gitlab features'
- end
-
- step 'I should see project "Shop" README' do
- page.should have_link 'README.md'
- page.should have_content 'testme'
- end
-end
diff --git a/features/steps/project/project_shortcuts.rb b/features/steps/project/project_shortcuts.rb
deleted file mode 100644
index a10e7bf78ee..00000000000
--- a/features/steps/project/project_shortcuts.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-class Spinach::Features::ProjectShortcuts < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedPaths
- include SharedProject
- include SharedProjectTab
-
- step 'I press "g" and "f"' do
- find('body').native.send_key('g')
- find('body').native.send_key('f')
- end
-
- step 'I press "g" and "c"' do
- find('body').native.send_key('g')
- find('body').native.send_key('c')
- end
-
- step 'I press "g" and "n"' do
- find('body').native.send_key('g')
- find('body').native.send_key('n')
- end
-
- step 'I press "g" and "g"' do
- find('body').native.send_key('g')
- find('body').native.send_key('g')
- end
-
- step 'I press "g" and "s"' do
- find('body').native.send_key('g')
- find('body').native.send_key('s')
- end
-
- step 'I press "g" and "w"' do
- find('body').native.send_key('g')
- find('body').native.send_key('w')
- end
-end
diff --git a/features/steps/project/redirects.rb b/features/steps/project/redirects.rb
deleted file mode 100644
index 57c6e39c801..00000000000
--- a/features/steps/project/redirects.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedPaths
- include SharedProject
-
- step 'public project "Community"' do
- create :project, :public, name: 'Community'
- end
-
- step 'private project "Enterprise"' do
- create :project, name: 'Enterprise'
- end
-
- step 'I visit project "Community" page' do
- project = Project.find_by(name: 'Community')
- visit namespace_project_path(project.namespace, project)
- end
-
- step 'I should see project "Community" home page' do
- Gitlab.config.gitlab.should_receive(:host).and_return("www.example.com")
- within '.navbar-gitlab .title' do
- page.should have_content 'Community'
- end
- end
-
- step 'I visit project "Enterprise" page' do
- project = Project.find_by(name: 'Enterprise')
- visit namespace_project_path(project.namespace, project)
- end
-
- step 'I visit project "CommunityDoesNotExist" page' do
- project = Project.find_by(name: 'Community')
- visit namespace_project_path(project.namespace, project) + 'DoesNotExist'
- end
-
- step 'I click on "Sign In"' do
- first(:link, "Sign in").click
- end
-
- step 'Authenticate' do
- admin = create(:admin)
- project = Project.find_by(name: 'Community')
- fill_in "user_login", with: admin.email
- fill_in "user_password", with: admin.password
- click_button "Sign in"
- Thread.current[:current_user] = admin
- end
-
- step 'I should be redirected to "Community" page' do
- project = Project.find_by(name: 'Community')
- current_path.should == "/#{project.path_with_namespace}"
- status_code.should == 200
- end
-
- step 'I get redirected to signin page where I sign in' do
- admin = create(:admin)
- project = Project.find_by(name: 'Enterprise')
- fill_in "user_login", with: admin.email
- fill_in "user_password", with: admin.password
- click_button "Sign in"
- Thread.current[:current_user] = admin
- end
-
- step 'I should be redirected to "Enterprise" page' do
- project = Project.find_by(name: 'Enterprise')
- current_path.should == "/#{project.path_with_namespace}"
- status_code.should == 200
- end
-end
diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb
deleted file mode 100644
index 4b3d79324ab..00000000000
--- a/features/steps/project/services.rb
+++ /dev/null
@@ -1,225 +0,0 @@
-class Spinach::Features::ProjectServices < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
-
- step 'I visit project "Shop" services page' do
- visit namespace_project_services_path(@project.namespace, @project)
- end
-
- step 'I should see list of available services' do
- page.should have_content 'Project services'
- page.should have_content 'Campfire'
- page.should have_content 'HipChat'
- page.should have_content 'GitLab CI'
- page.should have_content 'Assembla'
- page.should have_content 'Pushover'
- page.should have_content 'Atlassian Bamboo'
- page.should have_content 'JetBrains TeamCity'
- page.should have_content 'Asana'
- page.should have_content 'Irker (IRC gateway)'
- end
-
- step 'I click gitlab-ci service link' do
- click_link 'GitLab CI'
- end
-
- step 'I fill gitlab-ci settings' do
- check 'Active'
- fill_in 'Project url', with: 'http://ci.gitlab.org/projects/3'
- fill_in 'Token', with: 'verySecret'
- click_button 'Save'
- end
-
- step 'I should see service settings saved' do
- find_field('Project url').value.should == 'http://ci.gitlab.org/projects/3'
- end
-
- step 'I click hipchat service link' do
- click_link 'HipChat'
- end
-
- step 'I fill hipchat settings' do
- check 'Active'
- fill_in 'Room', with: 'gitlab'
- fill_in 'Token', with: 'verySecret'
- click_button 'Save'
- end
-
- step 'I should see hipchat service settings saved' do
- find_field('Room').value.should == 'gitlab'
- end
-
- step 'I fill hipchat settings with custom server' do
- check 'Active'
- fill_in 'Room', with: 'gitlab_custom'
- fill_in 'Token', with: 'secretCustom'
- fill_in 'Server', with: 'https://chat.example.com'
- click_button 'Save'
- end
-
- step 'I should see hipchat service settings with custom server saved' do
- find_field('Server').value.should == 'https://chat.example.com'
- end
-
- step 'I click pivotaltracker service link' do
- click_link 'PivotalTracker'
- end
-
- step 'I fill pivotaltracker settings' do
- check 'Active'
- fill_in 'Token', with: 'verySecret'
- click_button 'Save'
- end
-
- step 'I should see pivotaltracker service settings saved' do
- find_field('Token').value.should == 'verySecret'
- end
-
- step 'I click Flowdock service link' do
- click_link 'Flowdock'
- end
-
- step 'I fill Flowdock settings' do
- check 'Active'
- fill_in 'Token', with: 'verySecret'
- click_button 'Save'
- end
-
- step 'I should see Flowdock service settings saved' do
- find_field('Token').value.should == 'verySecret'
- end
-
- step 'I click Assembla service link' do
- click_link 'Assembla'
- end
-
- step 'I fill Assembla settings' do
- check 'Active'
- fill_in 'Token', with: 'verySecret'
- click_button 'Save'
- end
-
- step 'I should see Assembla service settings saved' do
- find_field('Token').value.should == 'verySecret'
- end
-
- step 'I click Asana service link' do
- click_link 'Asana'
- end
-
- step 'I fill Asana settings' do
- check 'Active'
- fill_in 'Api key', with: 'verySecret'
- fill_in 'Restrict to branch', with: 'master'
- click_button 'Save'
- end
-
- step 'I should see Asana service settings saved' do
- find_field('Api key').value.should == 'verySecret'
- find_field('Restrict to branch').value.should == 'master'
- end
-
- step 'I click email on push service link' do
- click_link 'Emails on push'
- end
-
- step 'I fill email on push settings' do
- fill_in 'Recipients', with: 'qa@company.name'
- click_button 'Save'
- end
-
- step 'I should see email on push service settings saved' do
- find_field('Recipients').value.should == 'qa@company.name'
- end
-
- step 'I click Irker service link' do
- click_link 'Irker (IRC gateway)'
- end
-
- step 'I fill Irker settings' do
- check 'Active'
- fill_in 'Recipients', with: 'irc://chat.freenode.net/#commits'
- check 'Colorize messages'
- click_button 'Save'
- end
-
- step 'I should see Irker service settings saved' do
- find_field('Recipients').value.should == 'irc://chat.freenode.net/#commits'
- find_field('Colorize messages').value.should == '1'
- end
-
- step 'I click Slack service link' do
- click_link 'Slack'
- end
-
- step 'I fill Slack settings' do
- check 'Active'
- fill_in 'Webhook', with: 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685'
- click_button 'Save'
- end
-
- step 'I should see Slack service settings saved' do
- find_field('Webhook').value.should == 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685'
- end
-
- step 'I click Pushover service link' do
- click_link 'Pushover'
- end
-
- step 'I fill Pushover settings' do
- check 'Active'
- fill_in 'Api key', with: 'verySecret'
- fill_in 'User key', with: 'verySecret'
- fill_in 'Device', with: 'myDevice'
- select 'High Priority', from: 'Priority'
- select 'Bike', from: 'Sound'
- click_button 'Save'
- end
-
- step 'I should see Pushover service settings saved' do
- find_field('Api key').value.should == 'verySecret'
- find_field('User key').value.should == 'verySecret'
- find_field('Device').value.should == 'myDevice'
- find_field('Priority').find('option[selected]').value.should == '1'
- find_field('Sound').find('option[selected]').value.should == 'bike'
- end
-
- step 'I click Atlassian Bamboo CI service link' do
- click_link 'Atlassian Bamboo CI'
- end
-
- step 'I fill Atlassian Bamboo CI settings' do
- check 'Active'
- fill_in 'Bamboo url', with: 'http://bamboo.example.com'
- fill_in 'Build key', with: 'KEY'
- fill_in 'Username', with: 'user'
- fill_in 'Password', with: 'verySecret'
- click_button 'Save'
- end
-
- step 'I should see Atlassian Bamboo CI service settings saved' do
- find_field('Bamboo url').value.should == 'http://bamboo.example.com'
- find_field('Build key').value.should == 'KEY'
- find_field('Username').value.should == 'user'
- end
-
- step 'I click JetBrains TeamCity CI service link' do
- click_link 'JetBrains TeamCity CI'
- end
-
- step 'I fill JetBrains TeamCity CI settings' do
- check 'Active'
- fill_in 'Teamcity url', with: 'http://teamcity.example.com'
- fill_in 'Build type', with: 'GitlabTest_Build'
- fill_in 'Username', with: 'user'
- fill_in 'Password', with: 'verySecret'
- click_button 'Save'
- end
-
- step 'I should see JetBrains TeamCity CI service settings saved' do
- find_field('Teamcity url').value.should == 'http://teamcity.example.com'
- find_field('Build type').value.should == 'GitlabTest_Build'
- find_field('Username').value.should == 'user'
- end
-end
diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb
deleted file mode 100644
index 343aeb53b11..00000000000
--- a/features/steps/project/snippets.rb
+++ /dev/null
@@ -1,95 +0,0 @@
-class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedNote
- include SharedPaths
-
- step 'project "Shop" have "Snippet one" snippet' do
- create(:project_snippet,
- title: "Snippet one",
- content: "Test content",
- file_name: "snippet.rb",
- project: project,
- author: project.users.first)
- end
-
- step 'project "Shop" have no "Snippet two" snippet' do
- create(:snippet,
- title: "Snippet two",
- content: "Test content",
- file_name: "snippet.rb",
- author: project.users.first)
- end
-
- step 'I click link "New Snippet"' do
- click_link "Add new snippet"
- end
-
- step 'I click link "Snippet one"' do
- click_link "Snippet one"
- end
-
- step 'I should see "Snippet one" in snippets' do
- page.should have_content "Snippet one"
- end
-
- step 'I should not see "Snippet two" in snippets' do
- page.should_not have_content "Snippet two"
- end
-
- step 'I should not see "Snippet one" in snippets' do
- page.should_not have_content "Snippet one"
- end
-
- step 'I click link "Edit"' do
- within ".file-title" do
- click_link "Edit"
- end
- end
-
- step 'I click link "Remove Snippet"' do
- click_link "remove"
- end
-
- step 'I submit new snippet "Snippet three"' do
- fill_in "project_snippet_title", :with => "Snippet three"
- fill_in "project_snippet_file_name", :with => "my_snippet.rb"
- within('.file-editor') do
- find(:xpath, "//input[@id='project_snippet_content']").set 'Content of snippet three'
- end
- click_button "Create snippet"
- end
-
- step 'I should see snippet "Snippet three"' do
- page.should have_content "Snippet three"
- page.should have_content "Content of snippet three"
- end
-
- step 'I submit new title "Snippet new title"' do
- fill_in "project_snippet_title", :with => "Snippet new title"
- click_button "Save"
- end
-
- step 'I should see "Snippet new title"' do
- page.should have_content "Snippet new title"
- end
-
- step 'I leave a comment like "Good snippet!"' do
- within('.js-main-target-form') do
- fill_in "note_note", with: "Good snippet!"
- click_button "Add Comment"
- end
- end
-
- step 'I should see comment "Good snippet!"' do
- page.should have_content "Good snippet!"
- end
-
- step 'I visit snippet page "Snippet one"' do
- visit namespace_project_snippet_path(project.namespace, project, project_snippet)
- end
-
- def project_snippet
- @project_snippet ||= ProjectSnippet.find_by!(title: "Snippet one")
- end
-end
diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb
deleted file mode 100644
index caf6c73ee06..00000000000
--- a/features/steps/project/source/browse_files.rb
+++ /dev/null
@@ -1,218 +0,0 @@
-class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
- include RepoHelpers
-
- step 'I should see files from repository' do
- page.should have_content "VERSION"
- page.should have_content ".gitignore"
- page.should have_content "LICENSE"
- end
-
- step 'I should see files from repository for "6d39438"' do
- current_path.should == namespace_project_tree_path(@project.namespace, @project, "6d39438")
- page.should have_content ".gitignore"
- page.should have_content "LICENSE"
- end
-
- step 'I see the ".gitignore"' do
- page.should have_content '.gitignore'
- end
-
- step 'I don\'t see the ".gitignore"' do
- page.should_not have_content '.gitignore'
- end
-
- step 'I click on ".gitignore" file in repo' do
- click_link ".gitignore"
- end
-
- step 'I should see its content' do
- page.should have_content old_gitignore_content
- end
-
- step 'I should see its new content' do
- page.should have_content new_gitignore_content
- end
-
- step 'I click link "Raw"' do
- click_link 'Raw'
- end
-
- step 'I should see raw file content' do
- source.should == sample_blob.data
- end
-
- step 'I click button "Edit"' do
- click_link 'Edit'
- end
-
- step 'I cannot see the edit button' do
- page.should_not have_link 'edit'
- end
-
- step 'The edit button is disabled' do
- page.should have_css '.disabled', text: 'Edit'
- end
-
- step 'I can edit code' do
- set_new_content
- evaluate_script('blob.editor.getValue()').should == new_gitignore_content
- end
-
- step 'I edit code' do
- set_new_content
- end
-
- step 'I fill the new file name' do
- fill_in :file_name, with: new_file_name
- end
-
- step 'I fill the new branch name' do
- fill_in :new_branch, with: 'new_branch_name'
- end
-
- step 'I fill the new file name with an illegal name' do
- fill_in :file_name, with: 'Spaces Not Allowed'
- end
-
- step 'I fill the commit message' do
- fill_in :commit_message, with: 'Not yet a commit message.'
- end
-
- step 'I click link "Diff"' do
- click_link 'Preview changes'
- end
-
- step 'I click on "Commit Changes"' do
- click_button 'Commit Changes'
- end
-
- step 'I click on "Remove"' do
- click_button 'Remove'
- end
-
- step 'I click on "Remove file"' do
- click_button 'Remove file'
- end
-
- step 'I see diff' do
- page.should have_css '.line_holder.new'
- end
-
- step 'I click on "new file" link in repo' do
- click_link 'new-file-link'
- end
-
- step 'I can see new file page' do
- page.should have_content "New file"
- page.should have_content "Commit message"
- end
-
- step 'I click on files directory' do
- click_link 'files'
- end
-
- step 'I click on History link' do
- click_link 'History'
- end
-
- step 'I see Browse dir link' do
- page.should have_link 'Browse Dir »'
- page.should_not have_link 'Browse Code »'
- end
-
- step 'I click on readme file' do
- within '.tree-table' do
- click_link 'README.md'
- end
- end
-
- step 'I see Browse file link' do
- page.should have_link 'Browse File »'
- page.should_not have_link 'Browse Code »'
- end
-
- step 'I see Browse code link' do
- page.should have_link 'Browse Code »'
- page.should_not have_link 'Browse File »'
- page.should_not have_link 'Browse Dir »'
- end
-
- step 'I click on Permalink' do
- click_link 'Permalink'
- end
-
- step 'I am redirected to the files URL' do
- current_path.should == namespace_project_tree_path(@project.namespace, @project, 'master')
- end
-
- step 'I am redirected to the ".gitignore"' do
- expect(current_path).to eq(namespace_project_blob_path(@project.namespace, @project, 'master/.gitignore'))
- end
-
- step 'I am redirected to the ".gitignore" on new branch' do
- expect(current_path).to eq(namespace_project_blob_path(@project.namespace, @project, 'new_branch_name/.gitignore'))
- end
-
- step 'I am redirected to the permalink URL' do
- expect(current_path).to(
- eq(namespace_project_blob_path(@project.namespace, @project,
- @project.repository.commit.sha +
- '/.gitignore'))
- )
- end
-
- step 'I am redirected to the new file' do
- expect(current_path).to eq(namespace_project_blob_path(
- @project.namespace, @project, 'master/' + new_file_name))
- end
-
- step 'I am redirected to the new file on new branch' do
- expect(current_path).to eq(namespace_project_blob_path(
- @project.namespace, @project, 'new_branch_name/' + new_file_name))
- end
-
- step "I don't see the permalink link" do
- expect(page).not_to have_link('permalink')
- end
-
- step 'I see a commit error message' do
- expect(page).to have_content('Your changes could not be committed')
- end
-
- step 'I create bare repo' do
- click_link 'Create empty bare repository'
- end
-
- step 'I click on "add a file" link' do
- click_link 'add a file'
-
- # Remove pre-receive hook so we can push without auth
- FileUtils.rm_f(File.join(@project.repository.path, 'hooks', 'pre-receive'))
- end
-
- private
-
- def set_new_content
- execute_script("blob.editor.setValue('#{new_gitignore_content}')")
- end
-
- # Content of the gitignore file on the seed repository.
- def old_gitignore_content
- '*.rbc'
- end
-
- # Constant value that differs from the content
- # of the gitignore of the seed repository.
- def new_gitignore_content
- old_gitignore_content + 'a'
- end
-
- # Constant value that is a valid filename and
- # not a filename present at root of the seed repository.
- def new_file_name
- 'not_a_file.md'
- end
-end
diff --git a/features/steps/project/source/git_blame.rb b/features/steps/project/source/git_blame.rb
deleted file mode 100644
index e29a816c51b..00000000000
--- a/features/steps/project/source/git_blame.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-class Spinach::Features::ProjectSourceGitBlame < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
-
- step 'I click on ".gitignore" file in repo' do
- click_link ".gitignore"
- end
-
- step 'I click Blame button' do
- click_link 'Blame'
- end
-
- step 'I should see git file blame' do
- page.should have_content "*.rb"
- page.should have_content "Dmitriy Zaporozhets"
- page.should have_content "Initial commit"
- end
-end
diff --git a/features/steps/project/source/markdown_render.rb b/features/steps/project/source/markdown_render.rb
deleted file mode 100644
index 7961fdedad8..00000000000
--- a/features/steps/project/source/markdown_render.rb
+++ /dev/null
@@ -1,288 +0,0 @@
-# If you need to modify the existing seed repository for your tests,
-# it is recommended that you make the changes on the `markdown` branch of the seed project repository,
-# which should only be used by tests in this file. See `/spec/factories.rb#project` for more info.
-class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedPaths
- include SharedMarkdown
-
- step 'I own project "Delta"' do
- @project = Project.find_by(name: "Delta")
- @project ||= create(:project, name: "Delta", namespace: @user.namespace)
- @project.team << [@user, :master]
- end
-
- step 'I should see files from repository in markdown' do
- current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown")
- page.should have_content "README.md"
- page.should have_content "CHANGELOG"
- end
-
- step 'I should see rendered README which contains correct links' do
- page.should have_content "Welcome to GitLab GitLab is a free project and repository management application"
- page.should have_link "GitLab API doc"
- page.should have_link "GitLab API website"
- page.should have_link "Rake tasks"
- page.should have_link "backup and restore procedure"
- page.should have_link "GitLab API doc directory"
- page.should have_link "Maintenance"
- end
-
- step 'I click on Gitlab API in README' do
- click_link "GitLab API doc"
- end
-
- step 'I should see correct document rendered' do
- current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md")
- page.should have_content "All API requests require authentication"
- end
-
- step 'I click on Rake tasks in README' do
- click_link "Rake tasks"
- end
-
- step 'I should see correct directory rendered' do
- current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/raketasks")
- page.should have_content "backup_restore.md"
- page.should have_content "maintenance.md"
- end
-
- step 'I click on GitLab API doc directory in README' do
- click_link "GitLab API doc directory"
- end
-
- step 'I should see correct doc/api directory rendered' do
- current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api")
- page.should have_content "README.md"
- page.should have_content "users.md"
- end
-
- step 'I click on Maintenance in README' do
- click_link "Maintenance"
- end
-
- step 'I should see correct maintenance file rendered' do
- current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/raketasks/maintenance.md")
- page.should have_content "bundle exec rake gitlab:env:info RAILS_ENV=production"
- end
-
- step 'I click on link "empty" in the README' do
- within('.readme-holder') do
- click_link "empty"
- end
- end
-
- step 'I click on link "id" in the README' do
- within('.readme-holder') do
- click_link "#id"
- end
- end
-
- step 'I navigate to the doc/api/README' do
- within '.tree-table' do
- click_link "doc"
- end
-
- within '.tree-table' do
- click_link "api"
- end
-
- within '.tree-table' do
- click_link "README.md"
- end
- end
-
- step 'I see correct file rendered' do
- current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md")
- page.should have_content "Contents"
- page.should have_link "Users"
- page.should have_link "Rake tasks"
- end
-
- step 'I click on users in doc/api/README' do
- click_link "Users"
- end
-
- step 'I should see the correct document file' do
- current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md")
- page.should have_content "Get a list of users."
- end
-
- step 'I click on raketasks in doc/api/README' do
- click_link "Rake tasks"
- end
-
- # Markdown branch
-
- When 'I visit markdown branch' do
- visit namespace_project_tree_path(@project.namespace, @project, "markdown")
- end
-
- When 'I visit markdown branch "README.md" blob' do
- visit namespace_project_blob_path(@project.namespace, @project, "markdown/README.md")
- end
-
- When 'I visit markdown branch "d" tree' do
- visit namespace_project_tree_path(@project.namespace, @project, "markdown/d")
- end
-
- When 'I visit markdown branch "d/README.md" blob' do
- visit namespace_project_blob_path(@project.namespace, @project, "markdown/d/README.md")
- end
-
- step 'I should see files from repository in markdown branch' do
- current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown")
- page.should have_content "README.md"
- page.should have_content "CHANGELOG"
- end
-
- step 'I see correct file rendered in markdown branch' do
- current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md")
- page.should have_content "Contents"
- page.should have_link "Users"
- page.should have_link "Rake tasks"
- end
-
- step 'I should see correct document rendered for markdown branch' do
- current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md")
- page.should have_content "All API requests require authentication"
- end
-
- step 'I should see correct directory rendered for markdown branch' do
- current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/raketasks")
- page.should have_content "backup_restore.md"
- page.should have_content "maintenance.md"
- end
-
- step 'I should see the users document file in markdown branch' do
- current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md")
- page.should have_content "Get a list of users."
- end
-
- # Expected link contents
-
- step 'The link with text "empty" should have url "tree/markdown"' do
- find('a', text: /^empty$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown")
- end
-
- step 'The link with text "empty" should have url "blob/markdown/README.md"' do
- find('a', text: /^empty$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md")
- end
-
- step 'The link with text "empty" should have url "tree/markdown/d"' do
- find('a', text: /^empty$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown/d")
- end
-
- step 'The link with text "empty" should have '\
- 'url "blob/markdown/d/README.md"' do
- find('a', text: /^empty$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/d/README.md")
- end
-
- step 'The link with text "ID" should have url "tree/markdownID"' do
- find('a', text: /^#id$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown") + '#id'
- end
-
- step 'The link with text "/ID" should have url "tree/markdownID"' do
- find('a', text: /^\/#id$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown") + '#id'
- end
-
- step 'The link with text "README.mdID" '\
- 'should have url "blob/markdown/README.mdID"' do
- find('a', text: /^README.md#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + '#id'
- end
-
- step 'The link with text "d/README.mdID" should have '\
- 'url "blob/markdown/d/README.mdID"' do
- find('a', text: /^d\/README.md#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "d/markdown/README.md") + '#id'
- end
-
- step 'The link with text "ID" should have url "blob/markdown/README.mdID"' do
- find('a', text: /^#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + '#id'
- end
-
- step 'The link with text "/ID" should have url "blob/markdown/README.mdID"' do
- find('a', text: /^\/#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + '#id'
- end
-
- # Wiki
-
- step 'I go to wiki page' do
- click_link "Wiki"
- current_path.should == namespace_project_wiki_path(@project.namespace, @project, "home")
- end
-
- step 'I add various links to the wiki page' do
- fill_in "wiki[content]", with: "[test](test)\n[GitLab API doc](api)\n[Rake tasks](raketasks)\n"
- fill_in "wiki[message]", with: "Adding links to wiki"
- click_button "Create page"
- end
-
- step 'Wiki page should have added links' do
- current_path.should == namespace_project_wiki_path(@project.namespace, @project, "home")
- page.should have_content "test GitLab API doc Rake tasks"
- end
-
- step 'I add a header to the wiki page' do
- fill_in "wiki[content]", with: "# Wiki header\n"
- fill_in "wiki[message]", with: "Add header to wiki"
- click_button "Create page"
- end
-
- step 'Wiki header should have correct id and link' do
- header_should_have_correct_id_and_link(1, 'Wiki header', 'wiki-header')
- end
-
- step 'I click on test link' do
- click_link "test"
- end
-
- step 'I see new wiki page named test' do
- current_path.should == namespace_project_wiki_path(@project.namespace, @project, "test")
- page.should have_content "Editing"
- end
-
- When 'I go back to wiki page home' do
- visit namespace_project_wiki_path(@project.namespace, @project, "home")
- current_path.should == namespace_project_wiki_path(@project.namespace, @project, "home")
- end
-
- step 'I click on GitLab API doc link' do
- click_link "GitLab API"
- end
-
- step 'I see Gitlab API document' do
- current_path.should == namespace_project_wiki_path(@project.namespace, @project, "api")
- page.should have_content "Editing"
- end
-
- step 'I click on Rake tasks link' do
- click_link "Rake tasks"
- end
-
- step 'I see Rake tasks directory' do
- current_path.should == namespace_project_wiki_path(@project.namespace, @project, "raketasks")
- page.should have_content "Editing"
- end
-
- step 'I go directory which contains README file' do
- visit namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api")
- current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api")
- end
-
- step 'I click on a relative link in README' do
- click_link "Users"
- end
-
- step 'I should see the correct markdown' do
- current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md")
- page.should have_content "List users"
- end
-
- step 'Header "Application details" should have correct id and link' do
- header_should_have_correct_id_and_link(2, 'Application details', 'application-details')
- end
-
- step 'Header "GitLab API" should have correct id and link' do
- header_should_have_correct_id_and_link(1, 'GitLab API', 'gitlab-api')
- end
-end
diff --git a/features/steps/project/source/multiselect_blob.rb b/features/steps/project/source/multiselect_blob.rb
deleted file mode 100644
index b749ba49371..00000000000
--- a/features/steps/project/source/multiselect_blob.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-class Spinach::Features::ProjectSourceMultiselectBlob < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
-
- class << self
- def click_line_steps(*line_numbers)
- line_numbers.each do |line_number|
- step "I click line #{line_number} in file" do
- find("#L#{line_number}").click
- end
-
- step "I shift-click line #{line_number} in file" do
- script = "$('#L#{line_number}').trigger($.Event('click', { shiftKey: true }));"
- execute_script(script)
- end
- end
- end
-
- def check_state_steps(*ranges)
- ranges.each do |range|
- fragment = range.kind_of?(Array) ? "L#{range.first}-#{range.last}" : "L#{range}"
- pluralization = range.kind_of?(Array) ? "s" : ""
-
- step "I should see \"#{fragment}\" as URI fragment" do
- URI.parse(current_url).fragment.should == fragment
- end
-
- step "I should see line#{pluralization} #{fragment[1..-1]} highlighted" do
- ids = Array(range).map { |n| "LC#{n}" }
- extra = false
-
- highlighted = all("#tree-content-holder .highlight .line.hll")
- highlighted.each do |element|
- extra ||= ids.delete(element[:id]).nil?
- end
-
- extra.should be_false and ids.should be_empty
- end
- end
- end
- end
-
- click_line_steps *Array(1..5)
- check_state_steps *Array(1..5), Array(1..2), Array(1..3), Array(1..4), Array(1..5), Array(3..5)
-
- step 'I go back in history' do
- go_back
- end
-
- step 'I go forward in history' do
- go_forward
- end
-
- step 'I click on ".gitignore" file in repo' do
- click_link ".gitignore"
- end
-end
diff --git a/features/steps/project/source/search_code.rb b/features/steps/project/source/search_code.rb
deleted file mode 100644
index 9c2864cc936..00000000000
--- a/features/steps/project/source/search_code.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-class Spinach::Features::ProjectSourceSearchCode < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
-
- step 'I search for term "coffee"' do
- fill_in "search", with: "coffee"
- click_button "Go"
- end
-
- step 'I should see files from repository containing "coffee"' do
- page.should have_content 'coffee'
- page.should have_content 'CONTRIBUTING.md'
- end
-
- step 'I should see empty result' do
- page.should have_content "We couldn't find any matching"
- end
-end
diff --git a/features/steps/project/star.rb b/features/steps/project/star.rb
deleted file mode 100644
index 50cdfd73c34..00000000000
--- a/features/steps/project/star.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-class Spinach::Features::ProjectStar < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
- include SharedUser
-
- step "The project has no stars" do
- page.should_not have_content '.star-buttons'
- end
-
- step "The project has 0 stars" do
- has_n_stars(0)
- end
-
- step "The project has 1 star" do
- has_n_stars(1)
- end
-
- step "The project has 2 stars" do
- has_n_stars(2)
- end
-
- # Requires @javascript
- step "I click on the star toggle button" do
- find(".star-btn", visible: true).click
- end
-
- step 'I redirected to sign in page' do
- current_path.should == new_user_session_path
- end
-
- protected
-
- def has_n_stars(n)
- expect(page).to have_css(".star-btn .count", text: n, visible: true)
- end
-end
diff --git a/features/steps/project/team_management.rb b/features/steps/project/team_management.rb
deleted file mode 100644
index e95621071c4..00000000000
--- a/features/steps/project/team_management.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
- include Select2Helper
-
- step 'I should be able to see myself in team' do
- page.should have_content(@user.name)
- page.should have_content(@user.username)
- end
-
- step 'I should see "Sam" in team list' do
- user = User.find_by(name: "Sam")
- page.should have_content(user.name)
- page.should have_content(user.username)
- end
-
- step 'I click link "Add members"' do
- find(:css, 'button.btn-new').click
- end
-
- step 'I select "Mike" as "Reporter"' do
- user = User.find_by(name: "Mike")
-
- within ".users-project-form" do
- select2(user.id, from: "#user_ids", multiple: true)
- select "Reporter", from: "access_level"
- end
- click_button "Add users to project"
- end
-
- step 'I should see "Mike" in team list as "Reporter"' do
- within ".access-reporter" do
- page.should have_content('Mike')
- end
- end
-
- step 'I select "sjobs@apple.com" as "Reporter"' do
- within ".users-project-form" do
- select2("sjobs@apple.com", from: "#user_ids", multiple: true)
- select "Reporter", from: "access_level"
- end
- click_button "Add users to project"
- end
-
- step 'I should see "sjobs@apple.com" in team list as invited "Reporter"' do
- within ".access-reporter" do
- page.should have_content('sjobs@apple.com')
- page.should have_content('invited')
- page.should have_content('Reporter')
- end
- end
-
- step 'I should see "Sam" in team list as "Developer"' do
- within ".access-developer" do
- page.should have_content('Sam')
- end
- end
-
- step 'I change "Sam" role to "Reporter"' do
- project = Project.find_by(name: "Shop")
- user = User.find_by(name: 'Sam')
- project_member = project.project_members.find_by(user_id: user.id)
- within "#project_member_#{project_member.id}" do
- click_button "Edit access level"
- select "Reporter", from: "project_member_access_level"
- click_button "Save"
- end
- end
-
- step 'I should see "Sam" in team list as "Reporter"' do
- within ".access-reporter" do
- page.should have_content('Sam')
- end
- end
-
- step 'I click link "Remove from team"' do
- click_link "Remove from team"
- end
-
- step 'I should not see "Sam" in team list' do
- user = User.find_by(name: "Sam")
- page.should_not have_content(user.name)
- page.should_not have_content(user.username)
- end
-
- step 'gitlab user "Mike"' do
- create(:user, name: "Mike")
- end
-
- step 'gitlab user "Sam"' do
- create(:user, name: "Sam")
- end
-
- step '"Sam" is "Shop" developer' do
- user = User.find_by(name: "Sam")
- project = Project.find_by(name: "Shop")
- project.team << [user, :developer]
- end
-
- step 'I own project "Website"' do
- @project = create(:empty_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
- click_link "Import members from another project"
- 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 "Sam"' do
- project = Project.find_by(name: "Shop")
- user = User.find_by(name: 'Sam')
- project_member = project.project_members.find_by(user_id: user.id)
- within "#project_member_#{project_member.id}" do
- click_link('Remove user from team')
- end
- end
-end
diff --git a/features/steps/project/wiki.rb b/features/steps/project/wiki.rb
deleted file mode 100644
index bb93e582a1f..00000000000
--- a/features/steps/project/wiki.rb
+++ /dev/null
@@ -1,165 +0,0 @@
-class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedNote
- include SharedPaths
- include WikiHelper
-
- step 'I click on the Cancel button' do
- within(:css, ".form-actions") do
- click_on "Cancel"
- end
- end
-
- step 'I should be redirected back to the Edit Home Wiki page' do
- current_path.should == namespace_project_wiki_path(project.namespace, project, :home)
- end
-
- step 'I create the Wiki Home page' do
- fill_in "wiki_content", with: '[link test](test)'
- click_on "Create page"
- end
-
- step 'I should see the newly created wiki page' do
- page.should have_content "Home"
- page.should have_content "link test"
-
- click_link "link test"
- page.should have_content "Editing"
- 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 namespace_project_wiki_path(project.namespace, 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
- page.should have_content "Updated Wiki Content"
- end
-
- step 'I should be redirected back to that Wiki page' do
- current_path.should == namespace_project_wiki_path(project.namespace, project, @page)
- end
-
- step 'That page has two revisions' do
- @page.update("new content", :markdown, "second commit")
- end
-
- step 'I click the History button' do
- click_on "History"
- end
-
- step 'I should see both revisions' do
- page.should have_content current_user.name
- page.should have_content "first commit"
- page.should have_content "second commit"
- end
-
- step 'I click on the "Delete this page" button' do
- click_on "Delete this page"
- end
-
- step 'The page should be deleted' do
- page.should have_content "Page was successfully deleted"
- end
-
- step 'I click on the "Pages" button' do
- click_on "Pages"
- end
-
- step 'I should see the existing page in the pages list' do
- page.should have_content current_user.name
- page.should have_content @page.title
- 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 ![image](image.jpg)", :markdown, "first commit")
- @wiki_page = wiki.find_page("pictures")
- end
-
- step 'I browse to wiki page with images' do
- visit namespace_project_wiki_path(project.namespace, 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")
- page.should have_link('image', href: "image.jpg")
- click_on "image"
- end
-
- step 'I should see the image from wiki repo' do
- current_path.should match('wikis/image.jpg')
- page.should_not 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
- page.should have_xpath("//img[@src=\"image.jpg\"]")
- end
-
- step 'I click on image link' do
- page.should have_link('image', href: "image.jpg")
- click_on "image"
- end
-
- step 'I should see the new wiki page form' do
- current_path.should match('wikis/image.jpg')
- page.should have_content('New Wiki Page')
- page.should have_content('Editing - image.jpg')
- end
-
- step 'I create a New page with paths' do
- click_on 'New Page'
- fill_in 'Page slug', with: 'one/two/three'
- click_on 'Build'
- fill_in "wiki_content", with: 'wiki content'
- click_on "Create page"
- current_path.should include 'one/two/three'
- end
-
- step 'I should see non-escaped link in the pages list' do
- page.should have_xpath("//a[@href='/#{project.path_with_namespace}/wikis/one/two/three']")
- end
-
- step 'I edit the Wiki page with a path' do
- click_on 'three'
- click_on 'Edit'
- end
-
- step 'I should see a non-escaped path' do
- current_path.should include 'one/two/three'
- end
-
- step 'I should see the Editing page' do
- page.should have_content('Editing')
- 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 should see the page history' do
- page.should have_content('History for')
- end
-
- def wiki
- @project_wiki = ProjectWiki.new(project, current_user)
- end
-end