summaryrefslogtreecommitdiff
path: root/features/steps/project
diff options
context:
space:
mode:
authorCiro Santilli <ciro.santilli@gmail.com>2014-09-21 23:40:22 +0200
committerCiro Santilli <ciro.santilli@gmail.com>2014-09-22 10:01:50 +0200
commitef6e94e37e0fce23acf32992476aeb63405be0c1 (patch)
tree3cfce6b15bab68f2213850672872de2ce420bae3 /features/steps/project
parentfda61a047ffb9b04bc4dd38e897088fde17fb3c1 (diff)
downloadgitlab-ce-ef6e94e37e0fce23acf32992476aeb63405be0c1.tar.gz
Replace old spinach step definitions with step.
Diffstat (limited to 'features/steps/project')
-rw-r--r--features/steps/project/active_tab.rb44
-rw-r--r--features/steps/project/archived.rb4
-rw-r--r--features/steps/project/browse_commits.rb32
-rw-r--r--features/steps/project/browse_commits_user_lookup.rb4
-rw-r--r--features/steps/project/browse_git_repo.rb6
-rw-r--r--features/steps/project/create.rb16
-rw-r--r--features/steps/project/graph.rb2
-rw-r--r--features/steps/project/issue_tracker.rb2
-rw-r--r--features/steps/project/issues.rb54
-rw-r--r--features/steps/project/markdown_render.rb93
-rw-r--r--features/steps/project/milestones.rb16
-rw-r--r--features/steps/project/network_graph.rb20
-rw-r--r--features/steps/project/snippets.rb32
-rw-r--r--features/steps/project/team_management.rb32
-rw-r--r--features/steps/project/wiki.rb48
15 files changed, 204 insertions, 201 deletions
diff --git a/features/steps/project/active_tab.rb b/features/steps/project/active_tab.rb
index 2862256e03b..3db80a4c6b4 100644
--- a/features/steps/project/active_tab.rb
+++ b/features/steps/project/active_tab.rb
@@ -7,97 +7,97 @@ class ProjectActiveTab < Spinach::FeatureSteps
# Sub Tabs: Home
- Given 'I click the "Team" tab' do
+ step 'I click the "Team" tab' do
click_link('Members')
end
- Given 'I click the "Attachments" tab' do
+ step 'I click the "Attachments" tab' do
click_link('Attachments')
end
- Given 'I click the "Snippets" tab' do
+ step 'I click the "Snippets" tab' do
click_link('Snippets')
end
- Given 'I click the "Edit" tab' do
+ step 'I click the "Edit" tab' do
within '.project-settings-nav' do
click_link('Project')
end
end
- Given 'I click the "Hooks" tab' do
+ step 'I click the "Hooks" tab' do
click_link('Web Hooks')
end
- Given 'I click the "Deploy Keys" tab' do
+ step 'I click the "Deploy Keys" tab' do
click_link('Deploy Keys')
end
- Then 'the active sub nav should be Team' do
+ step 'the active sub nav should be Team' do
ensure_active_sub_nav('Members')
end
- Then 'the active sub nav should be Edit' do
+ step 'the active sub nav should be Edit' do
ensure_active_sub_nav('Project')
end
- Then 'the active sub nav should be Hooks' do
+ step 'the active sub nav should be Hooks' do
ensure_active_sub_nav('Web Hooks')
end
- Then 'the active sub nav should be Deploy Keys' do
+ step 'the active sub nav should be Deploy Keys' do
ensure_active_sub_nav('Deploy Keys')
end
# Sub Tabs: Commits
- Given 'I click the "Compare" tab' do
+ step 'I click the "Compare" tab' do
click_link('Compare')
end
- Given 'I click the "Branches" tab' do
+ step 'I click the "Branches" tab' do
click_link('Branches')
end
- Given 'I click the "Tags" tab' do
+ step 'I click the "Tags" tab' do
click_link('Tags')
end
- Then 'the active sub tab should be Commits' do
+ step 'the active sub tab should be Commits' do
ensure_active_sub_tab('Commits')
end
- Then 'the active sub tab should be Compare' do
+ step 'the active sub tab should be Compare' do
ensure_active_sub_tab('Compare')
end
- Then 'the active sub tab should be Branches' do
+ step 'the active sub tab should be Branches' do
ensure_active_sub_tab('Branches')
end
- Then 'the active sub tab should be Tags' do
+ step 'the active sub tab should be Tags' do
ensure_active_sub_tab('Tags')
end
# Sub Tabs: Issues
- Given 'I click the "Milestones" tab' do
+ step 'I click the "Milestones" tab' do
click_link('Milestones')
end
- Given 'I click the "Labels" tab' do
+ step 'I click the "Labels" tab' do
click_link('Labels')
end
- Then 'the active sub tab should be Browse Issues' do
+ step 'the active sub tab should be Browse Issues' do
ensure_active_sub_tab('Browse Issues')
end
- Then 'the active sub tab should be Milestones' do
+ step 'the active sub tab should be Milestones' do
ensure_active_sub_tab('Milestones')
end
- Then 'the active sub tab should be Labels' do
+ step 'the active sub tab should be Labels' do
ensure_active_sub_tab('Labels')
end
end
diff --git a/features/steps/project/archived.rb b/features/steps/project/archived.rb
index 8b490d2ffc0..abb4806e5f1 100644
--- a/features/steps/project/archived.rb
+++ b/features/steps/project/archived.rb
@@ -18,11 +18,11 @@ class ProjectArchived < Spinach::FeatureSteps
visit project_path(project)
end
- Then 'I should not see "Archived"' do
+ step 'I should not see "Archived"' do
page.should_not have_content "Archived"
end
- Then 'I should see "Archived"' do
+ step 'I should see "Archived"' do
page.should have_content "Archived"
end
diff --git a/features/steps/project/browse_commits.rb b/features/steps/project/browse_commits.rb
index 37207aafebe..df961ea4687 100644
--- a/features/steps/project/browse_commits.rb
+++ b/features/steps/project/browse_commits.rb
@@ -4,18 +4,18 @@ class ProjectBrowseCommits < Spinach::FeatureSteps
include SharedPaths
include RepoHelpers
- Then 'I see project commits' do
+ 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.id.to_s[0..5])
end
- Given 'I click atom feed link' do
+ step 'I click atom feed link' do
click_link "Feed"
end
- Then 'I see commits atom feed' do
+ step 'I see commits atom feed' do
commit = @project.repository.commit
page.response_headers['Content-Type'].should have_content("application/atom+xml")
page.body.should have_selector("title", text: "Recent commits to #{@project.name}")
@@ -23,69 +23,69 @@ class ProjectBrowseCommits < Spinach::FeatureSteps
page.body.should have_selector("entry summary", text: commit.description[0..10])
end
- Given 'I click on commit link' do
+ step 'I click on commit link' do
visit project_commit_path(@project, sample_commit.id)
end
- Then 'I see commit info' do
+ 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
- And 'I fill compare fields with refs' do
+ 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
- Then 'I see compared refs' do
+ 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
- Then 'I see breadcrumb links' do
+ step 'I see breadcrumb links' do
page.should have_selector('ul.breadcrumb')
page.should have_selector('ul.breadcrumb a', count: 4)
end
- Then 'I see commits stats' do
+ 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
- Given 'I visit big commit page' do
+ step 'I visit big commit page' do
Commit::DIFF_SAFE_FILES = 20
visit project_commit_path(@project, sample_big_commit.id)
end
- Then 'I see big commit warning' do
+ 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
- Given 'I visit a commit with an image that changed' do
+ step 'I visit a commit with an image that changed' do
visit project_commit_path(@project, sample_image_commit.id)
end
- Then 'The diff links to both the previous and current image' do
+ step 'The diff links to both the previous and current image' do
links = page.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
- Given 'I click side-by-side diff button' do
+ step 'I click side-by-side diff button' do
click_link "Side-by-side Diff"
end
- Then 'I see side-by-side diff button' do
+ step 'I see side-by-side diff button' do
page.should have_content "Side-by-side Diff"
end
- Then 'I see inline diff button' do
+ step 'I see inline diff button' do
page.should have_content "Inline Diff"
end
end
diff --git a/features/steps/project/browse_commits_user_lookup.rb b/features/steps/project/browse_commits_user_lookup.rb
index 198ea29f28d..2680a32a1d8 100644
--- a/features/steps/project/browse_commits_user_lookup.rb
+++ b/features/steps/project/browse_commits_user_lookup.rb
@@ -3,11 +3,11 @@ class ProjectBrowseCommitsUserLookup < Spinach::FeatureSteps
include SharedProject
include SharedPaths
- Given 'I click on commit link' do
+ step 'I click on commit link' do
visit project_commit_path(@project, sample_commit.id)
end
- Given 'I click on another commit link' do
+ step 'I click on another commit link' do
visit project_commit_path(@project, sample_commit.parent_id)
end
diff --git a/features/steps/project/browse_git_repo.rb b/features/steps/project/browse_git_repo.rb
index 2c3017dd4e2..fb6fce4867a 100644
--- a/features/steps/project/browse_git_repo.rb
+++ b/features/steps/project/browse_git_repo.rb
@@ -3,15 +3,15 @@ class ProjectBrowseGitRepo < Spinach::FeatureSteps
include SharedProject
include SharedPaths
- Given 'I click on ".gitignore" file in repo' do
+ step 'I click on ".gitignore" file in repo' do
click_link ".gitignore"
end
- And 'I click blame button' do
+ step 'I click blame button' do
click_link "blame"
end
- Then 'I should see git file blame' do
+ 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"
diff --git a/features/steps/project/create.rb b/features/steps/project/create.rb
index b42e5bd3623..a2efa17c82d 100644
--- a/features/steps/project/create.rb
+++ b/features/steps/project/create.rb
@@ -2,41 +2,41 @@ class CreateProject < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
- And 'fill project form with valid data' do
+ step 'fill project form with valid data' do
fill_in 'project_name', with: 'Empty'
click_button "Create project"
end
- Then 'I should see project page' do
+ step 'I should see project page' do
page.should have_content "Empty"
current_path.should == project_path(Project.last)
end
- And 'I should see empty project instuctions' do
+ 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
- Then 'I see empty project instuctions' do
+ 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
- And 'I click on HTTP' do
+ step 'I click on HTTP' do
click_button 'HTTP'
end
- Then 'Remote url should update to http link' do
+ step 'Remote url should update to http link' do
page.should have_content "git remote add origin #{Project.last.http_url_to_repo}"
end
- And 'If I click on SSH' do
+ step 'If I click on SSH' do
click_button 'SSH'
end
- Then 'Remote url should update to ssh link' do
+ 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/graph.rb b/features/steps/project/graph.rb
index 89fe5fdeadf..eb7cc42e942 100644
--- a/features/steps/project/graph.rb
+++ b/features/steps/project/graph.rb
@@ -2,7 +2,7 @@ class ProjectGraph < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
- Then 'page should have graphs' do
+ step 'page should have graphs' do
page.should have_selector ".stat-graph"
end
diff --git a/features/steps/project/issue_tracker.rb b/features/steps/project/issue_tracker.rb
index c2fd4e15c9e..6bdfda86c10 100644
--- a/features/steps/project/issue_tracker.rb
+++ b/features/steps/project/issue_tracker.rb
@@ -25,7 +25,7 @@ class ProjectIssueTracker < Spinach::FeatureSteps
find_field('project_issues_tracker').value.should == 'redmine'
end
- And 'I save project' do
+ step 'I save project' do
click_button 'Save changes'
end
end
diff --git a/features/steps/project/issues.rb b/features/steps/project/issues.rb
index 65c243a7297..3b98eb1e926 100644
--- a/features/steps/project/issues.rb
+++ b/features/steps/project/issues.rb
@@ -5,47 +5,47 @@ class ProjectIssues < Spinach::FeatureSteps
include SharedPaths
include SharedMarkdown
- Given 'I should see "Release 0.4" in issues' do
+ step 'I should see "Release 0.4" in issues' do
page.should have_content "Release 0.4"
end
- And 'I should not see "Release 0.3" in issues' do
+ step 'I should not see "Release 0.3" in issues' do
page.should_not have_content "Release 0.3"
end
- And 'I should not see "Tweet control" in issues' do
+ step 'I should not see "Tweet control" in issues' do
page.should_not have_content "Tweet control"
end
- Given 'I click link "Closed"' do
+ step 'I click link "Closed"' do
click_link "Closed"
end
- Then 'I should see "Release 0.3" in issues' do
+ step 'I should see "Release 0.3" in issues' do
page.should have_content "Release 0.3"
end
- And 'I should not see "Release 0.4" in issues' do
+ step 'I should not see "Release 0.4" in issues' do
page.should_not have_content "Release 0.4"
end
- Given 'I click link "All"' do
+ step 'I click link "All"' do
click_link "All"
end
- Given 'I click link "Release 0.4"' do
+ step 'I click link "Release 0.4"' do
click_link "Release 0.4"
end
- Then 'I should see issue "Release 0.4"' do
+ step 'I should see issue "Release 0.4"' do
page.should have_content "Release 0.4"
end
- Given 'I click link "New Issue"' do
+ step 'I click link "New Issue"' do
click_link "New Issue"
end
- And 'I submit new issue "500 error on profile"' do
+ 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
@@ -56,7 +56,7 @@ class ProjectIssues < Spinach::FeatureSteps
click_button "Submit new issue"
end
- Given 'I click link "500 error on profile"' do
+ step 'I click link "500 error on profile"' do
click_link "500 error on profile"
end
@@ -66,41 +66,41 @@ class ProjectIssues < Spinach::FeatureSteps
end
end
- Then 'I should see issue "500 error on profile"' do
+ 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
- Given 'I fill in issue search with "Re"' do
+ step 'I fill in issue search with "Re"' do
filter_issue "Re"
end
- Given 'I fill in issue search with "Bu"' do
+ step 'I fill in issue search with "Bu"' do
filter_issue "Bu"
end
- And 'I fill in issue search with ".3"' do
+ step 'I fill in issue search with ".3"' do
filter_issue ".3"
end
- And 'I fill in issue search with "Something"' do
+ step 'I fill in issue search with "Something"' do
filter_issue "Something"
end
- And 'I fill in issue search with ""' do
+ step 'I fill in issue search with ""' do
filter_issue ""
end
- Given 'project "Shop" has milestone "v2.2"' do
+ 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
- And 'project "Shop" has milestone "v3.0"' do
+ step 'project "Shop" has milestone "v3.0"' do
milestone = create(:milestone, title: "v3.0", project: project)
@@ -111,7 +111,7 @@ class ProjectIssues < Spinach::FeatureSteps
select "v3.0", from: "milestone_id"
end
- Then 'I should see selected milestone with title "v3.0"' do
+ step 'I should see selected milestone with title "v3.0"' do
issues_milestone_selector = "#issue_milestone_id_chzn > a"
page.find(issues_milestone_selector).should have_content("v3.0")
end
@@ -122,14 +122,14 @@ class ProjectIssues < Spinach::FeatureSteps
select first_assignee.name, from: "assignee_id"
end
- Then 'I should see first assignee from "Shop" as selected assignee' do
+ 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
page.find(issues_assignee_selector).should have_content(assignee_name)
end
- And 'project "Shop" have "Release 0.4" open issue' do
+ step 'project "Shop" have "Release 0.4" open issue' do
create(:issue,
title: "Release 0.4",
@@ -139,21 +139,21 @@ class ProjectIssues < Spinach::FeatureSteps
)
end
- And 'project "Shop" have "Tweet control" open issue' do
+ step 'project "Shop" have "Tweet control" open issue' do
create(:issue,
title: "Tweet control",
project: project,
author: project.users.first)
end
- And 'project "Shop" have "Release 0.3" closed issue' do
+ step 'project "Shop" have "Release 0.3" closed issue' do
create(:closed_issue,
title: "Release 0.3",
project: project,
author: project.users.first)
end
- Given 'empty project "Empty Project"' do
+ step 'empty project "Empty Project"' do
create :empty_project, name: 'Empty Project', namespace: @user.namespace
end
@@ -162,7 +162,7 @@ class ProjectIssues < Spinach::FeatureSteps
visit project_path(project)
end
- And 'I see empty project details with ssh clone info' do
+ step 'I see empty project details with ssh clone info' do
project = Project.find_by(name: 'Empty Project')
page.all(:css, '.git-empty .clone').each do |element|
element.text.should include(project.url_to_repo)
diff --git a/features/steps/project/markdown_render.rb b/features/steps/project/markdown_render.rb
index 1885649891e..f4b71c02b38 100644
--- a/features/steps/project/markdown_render.rb
+++ b/features/steps/project/markdown_render.rb
@@ -6,19 +6,19 @@ class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps
include SharedPaths
include SharedMarkdown
- And 'I own project "Delta"' do
+ 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
- Then 'I should see files from repository in markdown' do
+ step 'I should see files from repository in markdown' do
current_path.should == project_tree_path(@project, "markdown")
page.should have_content "README.md"
page.should have_content "CHANGELOG"
end
- And 'I should see rendered README which contains correct links' do
+ 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"
@@ -28,79 +28,79 @@ class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps
page.should have_link "Maintenance"
end
- And 'I click on Gitlab API in README' do
+ step 'I click on Gitlab API in README' do
click_link "GitLab API doc"
end
- Then 'I should see correct document rendered' do
+ step 'I should see correct document rendered' do
current_path.should == project_blob_path(@project, "markdown/doc/api/README.md")
page.should have_content "All API requests require authentication"
end
- And 'I click on Rake tasks in README' do
+ step 'I click on Rake tasks in README' do
click_link "Rake tasks"
end
- Then 'I should see correct directory rendered' do
+ step 'I should see correct directory rendered' do
current_path.should == project_tree_path(@project, "markdown/doc/raketasks")
page.should have_content "backup_restore.md"
page.should have_content "maintenance.md"
end
- And 'I click on GitLab API doc directory in README' do
+ step 'I click on GitLab API doc directory in README' do
click_link "GitLab API doc directory"
end
- Then 'I should see correct doc/api directory rendered' do
+ step 'I should see correct doc/api directory rendered' do
current_path.should == project_tree_path(@project, "markdown/doc/api")
page.should have_content "README.md"
page.should have_content "users.md"
end
- And 'I click on Maintenance in README' do
+ step 'I click on Maintenance in README' do
click_link "Maintenance"
end
- Then 'I should see correct maintenance file rendered' do
+ step 'I should see correct maintenance file rendered' do
current_path.should == project_blob_path(@project, "markdown/doc/raketasks/maintenance.md")
page.should have_content "bundle exec rake gitlab:env:info RAILS_ENV=production"
end
- And 'I click on link "empty" in the README' do
+ step 'I click on link "empty" in the README' do
within('.readme-holder') do
click_link "empty"
end
end
- And 'I click on link "id" in the README' do
+ step 'I click on link "id" in the README' do
within('.readme-holder') do
click_link "#id"
end
end
- And 'I navigate to the doc/api/README' do
+ step 'I navigate to the doc/api/README' do
click_link "doc"
click_link "api"
click_link "README.md"
end
- And 'I see correct file rendered' do
+ step 'I see correct file rendered' do
current_path.should == project_blob_path(@project, "markdown/doc/api/README.md")
page.should have_content "Contents"
page.should have_link "Users"
page.should have_link "Rake tasks"
end
- And 'I click on users in doc/api/README' do
+ step 'I click on users in doc/api/README' do
click_link "Users"
end
- Then 'I should see the correct document file' do
+ step 'I should see the correct document file' do
current_path.should == project_blob_path(@project, "markdown/doc/api/users.md")
page.should have_content "Get a list of users."
end
- And 'I click on raketasks in doc/api/README' do
+ step 'I click on raketasks in doc/api/README' do
click_link "Rake tasks"
end
@@ -122,91 +122,94 @@ class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps
visit project_blob_path(@project, "markdown/d/README.md")
end
- Then 'I should see files from repository in markdown branch' do
+ step 'I should see files from repository in markdown branch' do
current_path.should == project_tree_path(@project, "markdown")
page.should have_content "README.md"
page.should have_content "CHANGELOG"
end
- And 'I see correct file rendered in markdown branch' do
+ step 'I see correct file rendered in markdown branch' do
current_path.should == project_blob_path(@project, "markdown/doc/api/README.md")
page.should have_content "Contents"
page.should have_link "Users"
page.should have_link "Rake tasks"
end
- Then 'I should see correct document rendered for markdown branch' do
+ step 'I should see correct document rendered for markdown branch' do
current_path.should == project_blob_path(@project, "markdown/doc/api/README.md")
page.should have_content "All API requests require authentication"
end
- Then 'I should see correct directory rendered for markdown branch' do
+ step 'I should see correct directory rendered for markdown branch' do
current_path.should == project_tree_path(@project, "markdown/doc/raketasks")
page.should have_content "backup_restore.md"
page.should have_content "maintenance.md"
end
- Then 'I should see the users document file in markdown branch' do
+ step 'I should see the users document file in markdown branch' do
current_path.should == project_blob_path(@project, "markdown/doc/api/users.md")
page.should have_content "Get a list of users."
end
# Expected link contents
- Then 'The link with text "empty" should have url "tree/markdown"' do
+ step 'The link with text "empty" should have url "tree/markdown"' do
find('a', text: /^empty$/)['href'] == current_host + project_tree_path(@project, "markdown")
end
- Then 'The link with text "empty" should have url "blob/markdown/README.md"' do
+ step 'The link with text "empty" should have url "blob/markdown/README.md"' do
find('a', text: /^empty$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md")
end
- Then 'The link with text "empty" should have url "tree/markdown/d"' do
+ step 'The link with text "empty" should have url "tree/markdown/d"' do
find('a', text: /^empty$/)['href'] == current_host + project_tree_path(@project, "markdown/d")
end
- Then 'The link with text "empty" should have url "blob/markdown/d/README.md"' do
+ step 'The link with text "empty" should have '\
+ 'url "blob/markdown/d/README.md"' do
find('a', text: /^empty$/)['href'] == current_host + project_blob_path(@project, "markdown/d/README.md")
end
- Then 'The link with text "ID" should have url "tree/markdownID"' do
+ step 'The link with text "ID" should have url "tree/markdownID"' do
find('a', text: /^#id$/)['href'] == current_host + project_tree_path(@project, "markdown") + '#id'
end
- Then 'The link with text "/ID" should have url "tree/markdownID"' do
+ step 'The link with text "/ID" should have url "tree/markdownID"' do
find('a', text: /^\/#id$/)['href'] == current_host + project_tree_path(@project, "markdown") + '#id'
end
- Then 'The link with text "README.mdID" should have url "blob/markdown/README.mdID"' do
+ step 'The link with text "README.mdID" '\
+ 'should have url "blob/markdown/README.mdID"' do
find('a', text: /^README.md#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id'
end
- Then 'The link with text "d/README.mdID" should have url "blob/markdown/d/README.mdID"' do
+ 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 + project_blob_path(@project, "d/markdown/README.md") + '#id'
end
- Then 'The link with text "ID" should have url "blob/markdown/README.mdID"' do
+ step 'The link with text "ID" should have url "blob/markdown/README.mdID"' do
find('a', text: /^#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id'
end
- Then 'The link with text "/ID" should have url "blob/markdown/README.mdID"' do
+ step 'The link with text "/ID" should have url "blob/markdown/README.mdID"' do
find('a', text: /^\/#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id'
end
# Wiki
- Given 'I go to wiki page' do
+ step 'I go to wiki page' do
click_link "Wiki"
current_path.should == project_wiki_path(@project, "home")
end
- And 'I add various links to the wiki page' do
+ 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
- Then 'Wiki page should have added links' do
+ step 'Wiki page should have added links' do
current_path.should == project_wiki_path(@project, "home")
page.should have_content "test GitLab API doc Rake tasks"
end
@@ -221,11 +224,11 @@ class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps
header_should_have_correct_id_and_link(1, 'Wiki header', 'wiki-header')
end
- And 'I click on test link' do
+ step 'I click on test link' do
click_link "test"
end
- Then 'I see new wiki page named test' do
+ step 'I see new wiki page named test' do
current_path.should == project_wiki_path(@project, "test")
page.should have_content "Editing"
end
@@ -235,34 +238,34 @@ class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps
current_path.should == project_wiki_path(@project, "home")
end
- And 'I click on GitLab API doc link' do
+ step 'I click on GitLab API doc link' do
click_link "GitLab API"
end
- Then 'I see Gitlab API document' do
+ step 'I see Gitlab API document' do
current_path.should == project_wiki_path(@project, "api")
page.should have_content "Editing"
end
- And 'I click on Rake tasks link' do
+ step 'I click on Rake tasks link' do
click_link "Rake tasks"
end
- Then 'I see Rake tasks directory' do
+ step 'I see Rake tasks directory' do
current_path.should == project_wiki_path(@project, "raketasks")
page.should have_content "Editing"
end
- Given 'I go directory which contains README file' do
+ step 'I go directory which contains README file' do
visit project_tree_path(@project, "markdown/doc/api")
current_path.should == project_tree_path(@project, "markdown/doc/api")
end
- And 'I click on a relative link in README' do
+ step 'I click on a relative link in README' do
click_link "Users"
end
- Then 'I should see the correct markdown' do
+ step 'I should see the correct markdown' do
current_path.should == project_blob_path(@project, "markdown/doc/api/users.md")
page.should have_content "List users"
end
diff --git a/features/steps/project/milestones.rb b/features/steps/project/milestones.rb
index 5562b523d1b..263668738e4 100644
--- a/features/steps/project/milestones.rb
+++ b/features/steps/project/milestones.rb
@@ -4,34 +4,34 @@ class ProjectMilestones < Spinach::FeatureSteps
include SharedPaths
include SharedMarkdown
- Then 'I should see milestone "v2.2"' do
+ 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("Browse Issues")
end
- Given 'I click link "v2.2"' do
+ step 'I click link "v2.2"' do
click_link "v2.2"
end
- Given 'I click link "New Milestone"' do
+ step 'I click link "New Milestone"' do
click_link "New Milestone"
end
- And 'I submit new milestone "v2.3"' do
+ step 'I submit new milestone "v2.3"' do
fill_in "milestone_title", with: "v2.3"
click_button "Create milestone"
end
- Then 'I should see milestone "v2.3"' do
+ 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("Browse Issues")
end
- And 'project "Shop" has milestone "v2.2"' do
+ step 'project "Shop" has milestone "v2.2"' do
project = Project.find_by(name: "Shop")
milestone = create(:milestone,
title: "v2.2",
@@ -41,7 +41,7 @@ class ProjectMilestones < Spinach::FeatureSteps
3.times { create(:issue, project: project, milestone: milestone) }
end
- Given 'the milestone has open and closed issues' do
+ step 'the milestone has open and closed issues' do
project = Project.find_by(name: "Shop")
milestone = project.milestones.find_by(title: 'v2.2')
@@ -53,7 +53,7 @@ class ProjectMilestones < Spinach::FeatureSteps
click_link 'All Issues'
end
- Then "I should see 3 issues" do
+ 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/network_graph.rb b/features/steps/project/network_graph.rb
index 9f5da288914..d678527ac07 100644
--- a/features/steps/project/network_graph.rb
+++ b/features/steps/project/network_graph.rb
@@ -3,7 +3,7 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
include SharedPaths
include SharedProject
- Then 'page should have network graph' do
+ step 'page should have network graph' do
page.should have_selector ".network-graph"
end
@@ -15,15 +15,15 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
visit project_network_path(project, "master")
end
- And 'page should select "master" in select box' do
+ step 'page should select "master" in select box' do
page.should have_selector '.select2-chosen', text: "master"
end
- And 'page should select "v1.0.0" in select box' do
+ step 'page should select "v1.0.0" in select box' do
page.should have_selector '.select2-chosen', text: "v1.0.0"
end
- And 'page should have "master" on graph' do
+ step 'page should have "master" on graph' do
within '.network-graph' do
page.should have_content 'master'
end
@@ -44,27 +44,27 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
sleep 2
end
- Then 'page should have content not containing "v1.0.0"' do
+ step 'page should have content not containing "v1.0.0"' do
within '.network-graph' do
page.should have_content 'Change some files'
end
end
- Then 'page should not have content not containing "v1.0.0"' do
+ 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
- And 'page should select "feature" in select box' do
+ step 'page should select "feature" in select box' do
page.should have_selector '.select2-chosen', text: "feature"
end
- And 'page should select "v1.0.0" in select box' do
+ step 'page should select "v1.0.0" in select box' do
page.should have_selector '.select2-chosen', text: "v1.0.0"
end
- And 'page should have "feature" on graph' do
+ step 'page should have "feature" on graph' do
within '.network-graph' do
page.should have_content 'feature'
end
@@ -78,7 +78,7 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
sleep 2
end
- And 'page should have "v1.0.0" on graph' do
+ step 'page should have "v1.0.0" on graph' do
within '.network-graph' do
page.should have_content 'v1.0.0'
end
diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb
index feae535fbea..2df7b007402 100644
--- a/features/steps/project/snippets.rb
+++ b/features/steps/project/snippets.rb
@@ -4,7 +4,7 @@ class ProjectSnippets < Spinach::FeatureSteps
include SharedNote
include SharedPaths
- And 'project "Shop" have "Snippet one" snippet' do
+ step 'project "Shop" have "Snippet one" snippet' do
create(:project_snippet,
title: "Snippet one",
content: "Test content",
@@ -13,7 +13,7 @@ class ProjectSnippets < Spinach::FeatureSteps
author: project.users.first)
end
- And 'project "Shop" have no "Snippet two" snippet' do
+ step 'project "Shop" have no "Snippet two" snippet' do
create(:snippet,
title: "Snippet two",
content: "Test content",
@@ -21,37 +21,37 @@ class ProjectSnippets < Spinach::FeatureSteps
author: project.users.first)
end
- Given 'I click link "New Snippet"' do
+ step 'I click link "New Snippet"' do
click_link "Add new snippet"
end
- Given 'I click link "Snippet one"' do
+ step 'I click link "Snippet one"' do
click_link "Snippet one"
end
- Then 'I should see "Snippet one" in snippets' do
+ step 'I should see "Snippet one" in snippets' do
page.should have_content "Snippet one"
end
- And 'I should not see "Snippet two" in snippets' do
+ step 'I should not see "Snippet two" in snippets' do
page.should_not have_content "Snippet two"
end
- And 'I should not see "Snippet one" in snippets' do
+ step 'I should not see "Snippet one" in snippets' do
page.should_not have_content "Snippet one"
end
- And 'I click link "Edit"' do
+ step 'I click link "Edit"' do
within ".file-title" do
click_link "Edit"
end
end
- And 'I click link "Remove Snippet"' do
+ step 'I click link "Remove Snippet"' do
click_link "remove"
end
- And 'I submit new snippet "Snippet three"' do
+ 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
@@ -60,32 +60,32 @@ class ProjectSnippets < Spinach::FeatureSteps
click_button "Create snippet"
end
- Then 'I should see snippet "Snippet three"' do
+ step 'I should see snippet "Snippet three"' do
page.should have_content "Snippet three"
page.should have_content "Content of snippet three"
end
- And 'I submit new title "Snippet new title"' do
+ step 'I submit new title "Snippet new title"' do
fill_in "project_snippet_title", :with => "Snippet new title"
click_button "Save"
end
- Then 'I should see "Snippet new title"' do
+ step 'I should see "Snippet new title"' do
page.should have_content "Snippet new title"
end
- And 'I leave a comment like "Good snippet!"' do
+ 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
- Then 'I should see comment "Good snippet!"' do
+ step 'I should see comment "Good snippet!"' do
page.should have_content "Good snippet!"
end
- And 'I visit snippet page "Snippet one"' do
+ step 'I visit snippet page "Snippet one"' do
visit project_snippet_path(project, project_snippet)
end
diff --git a/features/steps/project/team_management.rb b/features/steps/project/team_management.rb
index ffc5016529f..4653b772a8d 100644
--- a/features/steps/project/team_management.rb
+++ b/features/steps/project/team_management.rb
@@ -4,22 +4,22 @@ class ProjectTeamManagement < Spinach::FeatureSteps
include SharedPaths
include Select2Helper
- Then 'I should be able to see myself in team' do
+ step 'I should be able to see myself in team' do
page.should have_content(@user.name)
page.should have_content(@user.username)
end
- And 'I should see "Sam" in team list' do
+ 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
- Given 'I click link "New Team Member"' do
+ step 'I click link "New Team Member"' do
click_link "New project member"
end
- And 'I select "Mike" as "Reporter"' do
+ step 'I select "Mike" as "Reporter"' do
user = User.find_by(name: "Mike")
select2(user.id, from: "#user_ids", multiple: true)
@@ -29,67 +29,67 @@ class ProjectTeamManagement < Spinach::FeatureSteps
click_button "Add users"
end
- Then 'I should see "Mike" in team list as "Reporter"' do
+ step 'I should see "Mike" in team list as "Reporter"' do
within ".access-reporter" do
page.should have_content('Mike')
end
end
- Given 'I should see "Sam" in team list as "Developer"' do
+ step 'I should see "Sam" in team list as "Developer"' do
within ".access-developer" do
page.should have_content('Sam')
end
end
- And 'I change "Sam" role to "Reporter"' do
+ step 'I change "Sam" role to "Reporter"' do
user = User.find_by(name: "Sam")
within "#user_#{user.id}" do
select "Reporter", from: "team_member_project_access"
end
end
- And 'I should see "Sam" in team list as "Reporter"' do
+ step 'I should see "Sam" in team list as "Reporter"' do
within ".access-reporter" do
page.should have_content('Sam')
end
end
- And 'I click link "Remove from team"' do
+ step 'I click link "Remove from team"' do
click_link "Remove from team"
end
- And 'I should not see "Sam" in team list' do
+ 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
- And 'gitlab user "Mike"' do
+ step 'gitlab user "Mike"' do
create(:user, name: "Mike")
end
- And 'gitlab user "Sam"' do
+ step 'gitlab user "Sam"' do
create(:user, name: "Sam")
end
- And '"Sam" is "Shop" developer' do
+ step '"Sam" is "Shop" developer' do
user = User.find_by(name: "Sam")
project = Project.find_by(name: "Shop")
project.team << [user, :developer]
end
- Given 'I own project "Website"' do
+ step 'I own project "Website"' do
@project = create(:empty_project, name: "Website", namespace: @user.namespace)
@project.team << [@user, :master]
end
- And '"Mike" is "Website" reporter' do
+ step '"Mike" is "Website" reporter' do
user = User.find_by(name: "Mike")
project = Project.find_by(name: "Website")
project.team << [user, :reporter]
end
- And 'I click link "Import team from another project"' do
+ step 'I click link "Import team from another project"' do
click_link "Import members from another project"
end
diff --git a/features/steps/project/wiki.rb b/features/steps/project/wiki.rb
index 96f2505d24c..85375818d47 100644
--- a/features/steps/project/wiki.rb
+++ b/features/steps/project/wiki.rb
@@ -4,23 +4,23 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
include SharedNote
include SharedPaths
- Given 'I click on the Cancel button' do
+ step 'I click on the Cancel button' do
within(:css, ".form-actions") do
click_on "Cancel"
end
end
- Then 'I should be redirected back to the Edit Home Wiki page' do
+ step 'I should be redirected back to the Edit Home Wiki page' do
url = URI.parse(current_url)
url.path.should == project_wiki_path(project, :home)
end
- Given 'I create the Wiki Home page' do
+ step 'I create the Wiki Home page' do
fill_in "wiki_content", with: '[link test](test)'
click_on "Create page"
end
- Then 'I should see the newly created wiki page' do
+ step 'I should see the newly created wiki page' do
page.should have_content "Home"
page.should have_content "link test"
@@ -28,74 +28,74 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
page.should have_content "Editing"
end
- Given 'I have an existing Wiki page' do
+ step 'I have an existing Wiki page' do
wiki.create_page("existing", "content", :markdown, "first commit")
@page = wiki.find_page("existing")
end
- And 'I browse to that Wiki page' do
+ step 'I browse to that Wiki page' do
visit project_wiki_path(project, @page)
end
- And 'I click on the Edit button' do
+ step 'I click on the Edit button' do
click_on "Edit"
end
- And 'I change the content' do
+ step 'I change the content' do
fill_in "Content", with: 'Updated Wiki Content'
click_on "Save changes"
end
- Then 'I should see the updated content' do
+ step 'I should see the updated content' do
page.should have_content "Updated Wiki Content"
end
- Then 'I should be redirected back to that Wiki page' do
+ step 'I should be redirected back to that Wiki page' do
url = URI.parse(current_url)
url.path.should == project_wiki_path(project, @page)
end
- And 'That page has two revisions' do
+ step 'That page has two revisions' do
@page.update("new content", :markdown, "second commit")
end
- And 'I click the History button' do
+ step 'I click the History button' do
click_on "History"
end
- Then 'I should see both revisions' do
+ 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
- And 'I click on the "Delete this page" button' do
+ step 'I click on the "Delete this page" button' do
click_on "Delete this page"
end
- Then 'The page should be deleted' do
+ step 'The page should be deleted' do
page.should have_content "Page was successfully deleted"
end
- And 'I click on the "Pages" button' do
+ step 'I click on the "Pages" button' do
click_on "Pages"
end
- Then 'I should see the existing page in the pages list' do
+ 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
- Given 'I have an existing Wiki page with images linked on page' do
+ 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
- And 'I browse to wiki page with images' do
+ step 'I browse to wiki page with images' do
visit project_wiki_path(project, @wiki_page)
end
- And 'I click on existing image link' do
+ 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")
@@ -103,7 +103,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
click_on "image"
end
- Then 'I should see the image from wiki repo' do
+ step 'I should see the image from wiki repo' do
url = URI.parse(current_url)
url.path.should match("wikis/image.jpg")
page.should_not have_xpath('/html') # Page should render the image which means there is no html involved
@@ -111,16 +111,16 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
Gollum::File.any_instance.unstub(:mime_type)
end
- Then 'Image should be shown on the page' do
+ step 'Image should be shown on the page' do
page.should have_xpath("//img[@src=\"image.jpg\"]")
end
- And 'I click on image link' do
+ step 'I click on image link' do
page.should have_link('image', href: "image.jpg")
click_on "image"
end
- Then 'I should see the new wiki page form' do
+ step 'I should see the new wiki page form' do
url = URI.parse(current_url)
url.path.should match("wikis/image.jpg")
page.should have_content('New Wiki Page')