summaryrefslogtreecommitdiff
path: root/features/steps/project/source
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-06-12 00:44:13 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-06-12 05:12:09 -0400
commit69bbc413fec7aa4168d9ff12df5421674db90032 (patch)
tree215a7f16d4630067bf4863d8d6f992fcac23969e /features/steps/project/source
parentb07cf1182f78c5c46edbfa0fde668dd75ae47e05 (diff)
downloadgitlab-ce-69bbc413fec7aa4168d9ff12df5421674db90032.tar.gz
Update all `should`-style syntax to `expect` in features
Diffstat (limited to 'features/steps/project/source')
-rw-r--r--features/steps/project/source/browse_files.rb50
-rw-r--r--features/steps/project/source/git_blame.rb6
-rw-r--r--features/steps/project/source/markdown_render.rb106
-rw-r--r--features/steps/project/source/multiselect_blob.rb4
-rw-r--r--features/steps/project/source/search_code.rb6
5 files changed, 86 insertions, 86 deletions
diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb
index caf6c73ee06..58a6ef4f394 100644
--- a/features/steps/project/source/browse_files.rb
+++ b/features/steps/project/source/browse_files.rb
@@ -5,23 +5,23 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
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"
+ expect(page).to have_content "VERSION"
+ expect(page).to have_content ".gitignore"
+ expect(page).to 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"
+ expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "6d39438")
+ expect(page).to have_content ".gitignore"
+ expect(page).to have_content "LICENSE"
end
step 'I see the ".gitignore"' do
- page.should have_content '.gitignore'
+ expect(page).to have_content '.gitignore'
end
step 'I don\'t see the ".gitignore"' do
- page.should_not have_content '.gitignore'
+ expect(page).not_to have_content '.gitignore'
end
step 'I click on ".gitignore" file in repo' do
@@ -29,11 +29,11 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step 'I should see its content' do
- page.should have_content old_gitignore_content
+ expect(page).to have_content old_gitignore_content
end
step 'I should see its new content' do
- page.should have_content new_gitignore_content
+ expect(page).to have_content new_gitignore_content
end
step 'I click link "Raw"' do
@@ -41,7 +41,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step 'I should see raw file content' do
- source.should == sample_blob.data
+ expect(source).to eq sample_blob.data
end
step 'I click button "Edit"' do
@@ -49,16 +49,16 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step 'I cannot see the edit button' do
- page.should_not have_link 'edit'
+ expect(page).not_to have_link 'edit'
end
step 'The edit button is disabled' do
- page.should have_css '.disabled', text: 'Edit'
+ expect(page).to have_css '.disabled', text: 'Edit'
end
step 'I can edit code' do
set_new_content
- evaluate_script('blob.editor.getValue()').should == new_gitignore_content
+ expect(evaluate_script('blob.editor.getValue()')).to eq new_gitignore_content
end
step 'I edit code' do
@@ -98,7 +98,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step 'I see diff' do
- page.should have_css '.line_holder.new'
+ expect(page).to have_css '.line_holder.new'
end
step 'I click on "new file" link in repo' do
@@ -106,8 +106,8 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step 'I can see new file page' do
- page.should have_content "New file"
- page.should have_content "Commit message"
+ expect(page).to have_content "New file"
+ expect(page).to have_content "Commit message"
end
step 'I click on files directory' do
@@ -119,8 +119,8 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step 'I see Browse dir link' do
- page.should have_link 'Browse Dir »'
- page.should_not have_link 'Browse Code »'
+ expect(page).to have_link 'Browse Dir »'
+ expect(page).not_to have_link 'Browse Code »'
end
step 'I click on readme file' do
@@ -130,14 +130,14 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step 'I see Browse file link' do
- page.should have_link 'Browse File »'
- page.should_not have_link 'Browse Code »'
+ expect(page).to have_link 'Browse File »'
+ expect(page).not_to 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 »'
+ expect(page).to have_link 'Browse Code »'
+ expect(page).not_to have_link 'Browse File »'
+ expect(page).not_to have_link 'Browse Dir »'
end
step 'I click on Permalink' do
@@ -145,7 +145,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step 'I am redirected to the files URL' do
- current_path.should == namespace_project_tree_path(@project.namespace, @project, 'master')
+ expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, 'master')
end
step 'I am redirected to the ".gitignore"' do
diff --git a/features/steps/project/source/git_blame.rb b/features/steps/project/source/git_blame.rb
index e29a816c51b..d0a27f47e2a 100644
--- a/features/steps/project/source/git_blame.rb
+++ b/features/steps/project/source/git_blame.rb
@@ -12,8 +12,8 @@ class Spinach::Features::ProjectSourceGitBlame < Spinach::FeatureSteps
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"
+ expect(page).to have_content "*.rb"
+ expect(page).to have_content "Dmitriy Zaporozhets"
+ expect(page).to have_content "Initial commit"
end
end
diff --git a/features/steps/project/source/markdown_render.rb b/features/steps/project/source/markdown_render.rb
index 7961fdedad8..b6534f757c7 100644
--- a/features/steps/project/source/markdown_render.rb
+++ b/features/steps/project/source/markdown_render.rb
@@ -13,19 +13,19 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
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"
+ expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown")
+ expect(page).to have_content "README.md"
+ expect(page).to 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"
+ expect(page).to have_content "Welcome to GitLab GitLab is a free project and repository management application"
+ expect(page).to have_link "GitLab API doc"
+ expect(page).to have_link "GitLab API website"
+ expect(page).to have_link "Rake tasks"
+ expect(page).to have_link "backup and restore procedure"
+ expect(page).to have_link "GitLab API doc directory"
+ expect(page).to have_link "Maintenance"
end
step 'I click on Gitlab API in README' do
@@ -33,8 +33,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
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"
+ expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md")
+ expect(page).to have_content "All API requests require authentication"
end
step 'I click on Rake tasks in README' do
@@ -42,9 +42,9 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
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"
+ expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown/doc/raketasks")
+ expect(page).to have_content "backup_restore.md"
+ expect(page).to have_content "maintenance.md"
end
step 'I click on GitLab API doc directory in README' do
@@ -52,9 +52,9 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
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"
+ expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api")
+ expect(page).to have_content "README.md"
+ expect(page).to have_content "users.md"
end
step 'I click on Maintenance in README' do
@@ -62,8 +62,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
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"
+ expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/raketasks/maintenance.md")
+ expect(page).to have_content "bundle exec rake gitlab:env:info RAILS_ENV=production"
end
step 'I click on link "empty" in the README' do
@@ -93,10 +93,10 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
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"
+ expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md")
+ expect(page).to have_content "Contents"
+ expect(page).to have_link "Users"
+ expect(page).to have_link "Rake tasks"
end
step 'I click on users in doc/api/README' do
@@ -104,8 +104,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
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."
+ expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md")
+ expect(page).to have_content "Get a list of users."
end
step 'I click on raketasks in doc/api/README' do
@@ -131,32 +131,32 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
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"
+ expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown")
+ expect(page).to have_content "README.md"
+ expect(page).to 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"
+ expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md")
+ expect(page).to have_content "Contents"
+ expect(page).to have_link "Users"
+ expect(page).to 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"
+ expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md")
+ expect(page).to 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"
+ expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown/doc/raketasks")
+ expect(page).to have_content "backup_restore.md"
+ expect(page).to 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."
+ expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md")
+ expect(page).to have_content "Get a list of users."
end
# Expected link contents
@@ -208,7 +208,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
step 'I go to wiki page' do
click_link "Wiki"
- current_path.should == namespace_project_wiki_path(@project.namespace, @project, "home")
+ expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "home")
end
step 'I add various links to the wiki page' do
@@ -218,8 +218,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
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"
+ expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "home")
+ expect(page).to have_content "test GitLab API doc Rake tasks"
end
step 'I add a header to the wiki page' do
@@ -237,13 +237,13 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
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"
+ expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "test")
+ expect(page).to 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")
+ expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "home")
end
step 'I click on GitLab API doc link' do
@@ -251,8 +251,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
end
step 'I see Gitlab API document' do
- current_path.should == namespace_project_wiki_path(@project.namespace, @project, "api")
- page.should have_content "Editing"
+ expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "api")
+ expect(page).to have_content "Editing"
end
step 'I click on Rake tasks link' do
@@ -260,13 +260,13 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
end
step 'I see Rake tasks directory' do
- current_path.should == namespace_project_wiki_path(@project.namespace, @project, "raketasks")
- page.should have_content "Editing"
+ expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "raketasks")
+ expect(page).to 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")
+ expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api")
end
step 'I click on a relative link in README' do
@@ -274,8 +274,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
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"
+ expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md")
+ expect(page).to have_content "List users"
end
step 'Header "Application details" should have correct id and link' do
diff --git a/features/steps/project/source/multiselect_blob.rb b/features/steps/project/source/multiselect_blob.rb
index b749ba49371..212537fc333 100644
--- a/features/steps/project/source/multiselect_blob.rb
+++ b/features/steps/project/source/multiselect_blob.rb
@@ -23,7 +23,7 @@ class Spinach::Features::ProjectSourceMultiselectBlob < Spinach::FeatureSteps
pluralization = range.kind_of?(Array) ? "s" : ""
step "I should see \"#{fragment}\" as URI fragment" do
- URI.parse(current_url).fragment.should == fragment
+ expect(URI.parse(current_url).fragment).to eq fragment
end
step "I should see line#{pluralization} #{fragment[1..-1]} highlighted" do
@@ -35,7 +35,7 @@ class Spinach::Features::ProjectSourceMultiselectBlob < Spinach::FeatureSteps
extra ||= ids.delete(element[:id]).nil?
end
- extra.should be_false and ids.should be_empty
+ expect(extra).to be_false and ids.should be_empty
end
end
end
diff --git a/features/steps/project/source/search_code.rb b/features/steps/project/source/search_code.rb
index b66c5a4123a..feee756d7ec 100644
--- a/features/steps/project/source/search_code.rb
+++ b/features/steps/project/source/search_code.rb
@@ -9,11 +9,11 @@ class Spinach::Features::ProjectSourceSearchCode < Spinach::FeatureSteps
end
step 'I should see files from repository containing "coffee"' do
- page.should have_content 'coffee'
- page.should have_content 'CONTRIBUTING.md'
+ expect(page).to have_content 'coffee'
+ expect(page).to have_content 'CONTRIBUTING.md'
end
step 'I should see empty result' do
- page.should have_content "We couldn't find any"
+ expect(page).to have_content "We couldn't find any"
end
end