summaryrefslogtreecommitdiff
path: root/features/steps/shared
diff options
context:
space:
mode:
Diffstat (limited to 'features/steps/shared')
-rw-r--r--features/steps/shared/active_tab.rb6
-rw-r--r--features/steps/shared/admin.rb4
-rw-r--r--features/steps/shared/authentication.rb4
-rw-r--r--features/steps/shared/diff_note.rb50
-rw-r--r--features/steps/shared/note.rb34
-rw-r--r--features/steps/shared/paths.rb8
-rw-r--r--features/steps/shared/project.rb14
-rw-r--r--features/steps/shared/snippet.rb6
8 files changed, 63 insertions, 63 deletions
diff --git a/features/steps/shared/active_tab.rb b/features/steps/shared/active_tab.rb
index c776af14e04..f4ef33cc7a4 100644
--- a/features/steps/shared/active_tab.rb
+++ b/features/steps/shared/active_tab.rb
@@ -13,15 +13,15 @@ module SharedActiveTab
page.find('div.content ul.nav-stacked-menu li.active').should have_content(content)
end
- And 'no other main tabs should be active' do
+ step 'no other main tabs should be active' do
page.should have_selector('.main-nav li.active', count: 1)
end
- And 'no other sub tabs should be active' do
+ step 'no other sub tabs should be active' do
page.should have_selector('div.content ul.nav-tabs li.active', count: 1)
end
- And 'no other sub navs should be active' do
+ step 'no other sub navs should be active' do
page.should have_selector('div.content ul.nav-stacked-menu li.active', count: 1)
end
diff --git a/features/steps/shared/admin.rb b/features/steps/shared/admin.rb
index 1b712dc6d04..b6072995677 100644
--- a/features/steps/shared/admin.rb
+++ b/features/steps/shared/admin.rb
@@ -1,11 +1,11 @@
module SharedAdmin
include Spinach::DSL
- And 'there are projects in system' do
+ step 'there are projects in system' do
2.times { create(:project) }
end
- And 'system has users' do
+ step 'system has users' do
2.times { create(:user) }
end
end
diff --git a/features/steps/shared/authentication.rb b/features/steps/shared/authentication.rb
index b48021dc146..ac8a3df6bb9 100644
--- a/features/steps/shared/authentication.rb
+++ b/features/steps/shared/authentication.rb
@@ -4,11 +4,11 @@ module SharedAuthentication
include Spinach::DSL
include LoginHelpers
- Given 'I sign in as a user' do
+ step 'I sign in as a user' do
login_as :user
end
- Given 'I sign in as an admin' do
+ step 'I sign in as an admin' do
login_as :admin
end
diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb
index b107b083220..7d017669b7c 100644
--- a/features/steps/shared/diff_note.rb
+++ b/features/steps/shared/diff_note.rb
@@ -2,24 +2,24 @@ module SharedDiffNote
include Spinach::DSL
include RepoHelpers
- Given 'I cancel the diff comment' do
+ step 'I cancel the diff comment' do
within(diff_file_selector) do
find(".js-close-discussion-note-form").click
end
end
- Given 'I delete a diff comment' do
+ step 'I delete a diff comment' do
find('.note').hover
find(".js-note-delete").click
end
- Given 'I haven\'t written any diff comment text' do
+ step 'I haven\'t written any diff comment text' do
within(diff_file_selector) do
fill_in "note[note]", with: ""
end
end
- Given 'I leave a diff comment like "Typo, please fix"' do
+ step 'I leave a diff comment like "Typo, please fix"' do
click_diff_line(sample_commit.line_code)
within("#{diff_file_selector} form[rel$='#{sample_commit.line_code}']") do
fill_in "note[note]", with: "Typo, please fix"
@@ -28,7 +28,7 @@ module SharedDiffNote
end
end
- Given 'I preview a diff comment text like "Should fix it :smile:"' do
+ step 'I preview a diff comment text like "Should fix it :smile:"' do
click_diff_line(sample_commit.line_code)
within("#{diff_file_selector} form[rel$='#{sample_commit.line_code}']") do
fill_in "note[note]", with: "Should fix it :smile:"
@@ -36,7 +36,7 @@ module SharedDiffNote
end
end
- Given 'I preview another diff comment text like "DRY this up"' do
+ step 'I preview another diff comment text like "DRY this up"' do
click_diff_line(sample_commit.del_line_code)
within("#{diff_file_selector} form[rel$='#{sample_commit.del_line_code}']") do
@@ -45,109 +45,109 @@ module SharedDiffNote
end
end
- Given 'I open a diff comment form' do
+ step 'I open a diff comment form' do
click_diff_line(sample_commit.line_code)
end
- Given 'I open another diff comment form' do
+ step 'I open another diff comment form' do
click_diff_line(sample_commit.del_line_code)
end
- Given 'I write a diff comment like ":-1: I don\'t like this"' do
+ step 'I write a diff comment like ":-1: I don\'t like this"' do
within(diff_file_selector) do
fill_in "note[note]", with: ":-1: I don\'t like this"
end
end
- Given 'I submit the diff comment' do
+ step 'I submit the diff comment' do
within(diff_file_selector) do
click_button("Add Comment")
end
end
- Then 'I should not see the diff comment form' do
+ step 'I should not see the diff comment form' do
within(diff_file_selector) do
page.should_not have_css("form.new_note")
end
end
- Then 'I should not see the diff comment preview button' do
+ step 'I should not see the diff comment preview button' do
within(diff_file_selector) do
page.should have_css(".js-note-preview-button", visible: false)
end
end
- Then 'I should not see the diff comment text field' do
+ step 'I should not see the diff comment text field' do
within(diff_file_selector) do
page.should have_css(".js-note-text", visible: false)
end
end
- Then 'I should only see one diff form' do
+ step 'I should only see one diff form' do
within(diff_file_selector) do
page.should have_css("form.new_note", count: 1)
end
end
- Then 'I should see a diff comment form with ":-1: I don\'t like this"' do
+ step 'I should see a diff comment form with ":-1: I don\'t like this"' do
within(diff_file_selector) do
page.should have_field("note[note]", with: ":-1: I don\'t like this")
end
end
- Then 'I should see a diff comment saying "Typo, please fix"' do
+ step 'I should see a diff comment saying "Typo, please fix"' do
within("#{diff_file_selector} .note") do
page.should have_content("Typo, please fix")
end
end
- Then 'I should see a discussion reply button' do
+ step 'I should see a discussion reply button' do
within(diff_file_selector) do
page.should have_link("Reply")
end
end
- Then 'I should see a temporary diff comment form' do
+ step 'I should see a temporary diff comment form' do
within(diff_file_selector) do
page.should have_css(".js-temp-notes-holder form.new_note")
end
end
- Then 'I should see add a diff comment button' do
+ step 'I should see add a diff comment button' do
page.should have_css(".js-add-diff-note-button", visible: false)
end
- Then 'I should see an empty diff comment form' do
+ step 'I should see an empty diff comment form' do
within(diff_file_selector) do
page.should have_field("note[note]", with: "")
end
end
- Then 'I should see the cancel comment button' do
+ step 'I should see the cancel comment button' do
within("#{diff_file_selector} form") do
page.should have_css(".js-close-discussion-note-form", text: "Cancel")
end
end
- Then 'I should see the diff comment preview' do
+ step 'I should see the diff comment preview' do
within("#{diff_file_selector} form") do
page.should have_css(".js-note-preview", visible: false)
end
end
- Then 'I should see the diff comment edit button' do
+ step 'I should see the diff comment edit button' do
within(diff_file_selector) do
page.should have_css(".js-note-write-button", visible: true)
end
end
- Then 'I should see the diff comment preview button' do
+ step 'I should see the diff comment preview button' do
within(diff_file_selector) do
page.should have_css(".js-note-preview-button", visible: true)
end
end
- Then 'I should see two separate previews' do
+ step 'I should see two separate previews' do
within(diff_file_selector) do
page.should have_css(".js-note-preview", visible: true, count: 2)
page.should have_content("Should fix it")
diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb
index 1c52d4c72d8..4019fe3697a 100644
--- a/features/steps/shared/note.rb
+++ b/features/steps/shared/note.rb
@@ -1,18 +1,18 @@
module SharedNote
include Spinach::DSL
- Given 'I delete a comment' do
+ step 'I delete a comment' do
find('.note').hover
find(".js-note-delete").click
end
- Given 'I haven\'t written any comment text' do
+ step 'I haven\'t written any comment text' do
within(".js-main-target-form") do
fill_in "note[note]", with: ""
end
end
- Given 'I leave a comment like "XML attached"' do
+ step 'I leave a comment like "XML attached"' do
within(".js-main-target-form") do
fill_in "note[note]", with: "XML attached"
click_button "Add Comment"
@@ -20,84 +20,84 @@ module SharedNote
end
end
- Given 'I preview a comment text like "Bug fixed :smile:"' do
+ step 'I preview a comment text like "Bug fixed :smile:"' do
within(".js-main-target-form") do
fill_in "note[note]", with: "Bug fixed :smile:"
find(".js-note-preview-button").trigger("click")
end
end
- Given 'I submit the comment' do
+ step 'I submit the comment' do
within(".js-main-target-form") do
click_button "Add Comment"
end
end
- Given 'I write a comment like "Nice"' do
+ step 'I write a comment like "Nice"' do
within(".js-main-target-form") do
fill_in "note[note]", with: "Nice"
end
end
- Then 'I should not see a comment saying "XML attached"' do
+ step 'I should not see a comment saying "XML attached"' do
page.should_not have_css(".note")
end
- Then 'I should not see the cancel comment button' do
+ step 'I should not see the cancel comment button' do
within(".js-main-target-form") do
should_not have_link("Cancel")
end
end
- Then 'I should not see the comment preview' do
+ step 'I should not see the comment preview' do
within(".js-main-target-form") do
page.should have_css(".js-note-preview", visible: false)
end
end
- Then 'I should not see the comment preview button' do
+ step 'I should not see the comment preview button' do
within(".js-main-target-form") do
page.should have_css(".js-note-preview-button", visible: false)
end
end
- Then 'I should not see the comment text field' do
+ step 'I should not see the comment text field' do
within(".js-main-target-form") do
page.should have_css(".js-note-text", visible: false)
end
end
- Then 'I should see a comment saying "XML attached"' do
+ step 'I should see a comment saying "XML attached"' do
within(".note") do
page.should have_content("XML attached")
end
end
- Then 'I should see an empty comment text field' do
+ step 'I should see an empty comment text field' do
within(".js-main-target-form") do
page.should have_field("note[note]", with: "")
end
end
- Then 'I should see the comment edit button' do
+ step 'I should see the comment edit button' do
within(".js-main-target-form") do
page.should have_css(".js-note-write-button", visible: true)
end
end
- Then 'I should see the comment preview' do
+ step 'I should see the comment preview' do
within(".js-main-target-form") do
page.should have_css(".js-note-preview", visible: true)
end
end
- Then 'I should see the comment preview button' do
+ step 'I should see the comment preview button' do
within(".js-main-target-form") do
page.should have_css(".js-note-preview-button", visible: true)
end
end
- Then 'I should see comment "XML attached"' do
+ step 'I should see comment "XML attached"' do
within(".note") do
page.should have_content("XML attached")
end
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb
index 276947dc060..ed0c623d1dc 100644
--- a/features/steps/shared/paths.rb
+++ b/features/steps/shared/paths.rb
@@ -394,15 +394,15 @@ module SharedPaths
# Snippets
# ----------------------------------------
- Given 'I visit project "Shop" snippets page' do
+ step 'I visit project "Shop" snippets page' do
visit project_snippets_path(project)
end
- Given 'I visit snippets page' do
+ step 'I visit snippets page' do
visit snippets_path
end
- Given 'I visit new snippet page' do
+ step 'I visit new snippet page' do
visit new_snippet_path
end
@@ -418,7 +418,7 @@ module SharedPaths
# Errors
# ----------------------------------------
- Then 'page status code should be 404' do
+ step 'page status code should be 404' do
page.status_code.should == 404
end
end
diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb
index c131976614f..4b833850a1c 100644
--- a/features/steps/shared/project.rb
+++ b/features/steps/shared/project.rb
@@ -2,33 +2,33 @@ module SharedProject
include Spinach::DSL
# Create a project without caring about what it's called
- And "I own a project" do
+ step "I own a project" do
@project = create(:project, namespace: @user.namespace)
@project.team << [@user, :master]
end
# Create a specific project called "Shop"
- And 'I own project "Shop"' do
+ step 'I own project "Shop"' do
@project = Project.find_by(name: "Shop")
@project ||= create(:project, name: "Shop", namespace: @user.namespace, snippets_enabled: true)
@project.team << [@user, :master]
end
# Create another specific project called "Forum"
- And 'I own project "Forum"' do
+ step 'I own project "Forum"' do
@project = Project.find_by(name: "Forum")
@project ||= create(:project, name: "Forum", namespace: @user.namespace, path: 'forum_project')
@project.team << [@user, :master]
end
# Create an empty project without caring about the name
- And 'I own an empty project' do
+ step 'I own an empty project' do
@project = create(:empty_project,
name: 'Empty Project', namespace: @user.namespace)
@project.team << [@user, :master]
end
- And 'project "Shop" has push event' do
+ step 'project "Shop" has push event' do
@project = Project.find_by(name: "Shop")
data = {
@@ -54,12 +54,12 @@ module SharedProject
)
end
- Then 'I should see project "Shop" activity feed' do
+ step 'I should see project "Shop" activity feed' do
project = Project.find_by(name: "Shop")
page.should have_content "#{@user.name} pushed new branch fix at #{project.name_with_namespace}"
end
- Then 'I should see project settings' do
+ step 'I should see project settings' do
current_path.should == edit_project_path(@project)
page.should have_content("Project name")
page.should have_content("Features:")
diff --git a/features/steps/shared/snippet.rb b/features/steps/shared/snippet.rb
index c64299ae6f3..5a27e8750cf 100644
--- a/features/steps/shared/snippet.rb
+++ b/features/steps/shared/snippet.rb
@@ -1,7 +1,7 @@
module SharedSnippet
include Spinach::DSL
- And 'I have public "Personal snippet one" snippet' do
+ step 'I have public "Personal snippet one" snippet' do
create(:personal_snippet,
title: "Personal snippet one",
content: "Test content",
@@ -10,7 +10,7 @@ module SharedSnippet
author: current_user)
end
- And 'I have private "Personal snippet private" snippet' do
+ step 'I have private "Personal snippet private" snippet' do
create(:personal_snippet,
title: "Personal snippet private",
content: "Provate content",
@@ -18,7 +18,7 @@ module SharedSnippet
private: true,
author: current_user)
end
- And 'I have a public many lined snippet' do
+ step 'I have a public many lined snippet' do
create(:personal_snippet,
title: 'Many lined snippet',
content: <<-END.gsub(/^\s+\|/, ''),