diff options
author | Vinnie Okada <vokada@mrvinn.com> | 2015-01-24 21:02:58 +0300 |
---|---|---|
committer | Vinnie Okada <vokada@mrvinn.com> | 2015-02-14 21:09:23 +0300 |
commit | 76aad9b76ed756ca9ba2cbcdb399c815e542b3ae (patch) | |
tree | 7226e0ce64796abbf4848582baed8d173ddecd14 /features/steps/project/source | |
parent | 5725b6daad2f403f13112cfcafa5b45ac126c0ca (diff) |
Upgrade to Rails 4.1.9
Make the following changes to deal with new behavior in Rails 4.1.2:
* Use nested resources to avoid slashes in arguments to path helpers.
Diffstat (limited to 'features/steps/project/source')
-rw-r--r-- | features/steps/project/source/browse_files.rb | 17 | ||||
-rw-r--r-- | features/steps/project/source/markdown_render.rb | 72 |
2 files changed, 46 insertions, 43 deletions
diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index 1fe01e55aa4..98d8a60e1a5 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -11,7 +11,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I should see files from repository for "6d39438"' do - current_path.should == project_tree_path(@project, "6d39438") + current_path.should == namespace_project_tree_path(@project.namespace, @project, "6d39438") page.should have_content ".gitignore" page.should have_content "LICENSE" end @@ -141,21 +141,24 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I am redirected to the files URL' do - current_path.should == project_tree_path(@project, 'master') + 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(project_blob_path(@project, 'master/.gitignore')) + expect(current_path).to eq(namespace_project_blob_path(@project.namespace, @project, 'master/.gitignore')) end step 'I am redirected to the permalink URL' do - expect(current_path).to eq(project_blob_path( - @project, @project.repository.commit.sha + '/.gitignore')) + 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(project_blob_path( - @project, 'master/' + new_file_name)) + expect(current_path).to eq(namespace_project_blob_path( + @project.namespace, @project, 'master/' + new_file_name)) end step "I don't see the permalink link" do diff --git a/features/steps/project/source/markdown_render.rb b/features/steps/project/source/markdown_render.rb index 53578ee5970..7961fdedad8 100644 --- a/features/steps/project/source/markdown_render.rb +++ b/features/steps/project/source/markdown_render.rb @@ -13,7 +13,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see files from repository in markdown' do - current_path.should == project_tree_path(@project, "markdown") + current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown") page.should have_content "README.md" page.should have_content "CHANGELOG" end @@ -33,7 +33,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct document rendered' do - current_path.should == project_blob_path(@project, "markdown/doc/api/README.md") + 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 @@ -42,7 +42,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct directory rendered' do - current_path.should == project_tree_path(@project, "markdown/doc/raketasks") + 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 @@ -52,7 +52,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct doc/api directory rendered' do - current_path.should == project_tree_path(@project, "markdown/doc/api") + 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 @@ -62,7 +62,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct maintenance file rendered' do - current_path.should == project_blob_path(@project, "markdown/doc/raketasks/maintenance.md") + 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 @@ -93,7 +93,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see correct file rendered' do - current_path.should == project_blob_path(@project, "markdown/doc/api/README.md") + 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" @@ -104,7 +104,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see the correct document file' do - current_path.should == project_blob_path(@project, "markdown/doc/api/users.md") + 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 @@ -115,100 +115,100 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps # Markdown branch When 'I visit markdown branch' do - visit project_tree_path(@project, "markdown") + visit namespace_project_tree_path(@project.namespace, @project, "markdown") end When 'I visit markdown branch "README.md" blob' do - visit project_blob_path(@project, "markdown/README.md") + visit namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") end When 'I visit markdown branch "d" tree' do - visit project_tree_path(@project, "markdown/d") + visit namespace_project_tree_path(@project.namespace, @project, "markdown/d") end When 'I visit markdown branch "d/README.md" blob' do - visit project_blob_path(@project, "markdown/d/README.md") + 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 == project_tree_path(@project, "markdown") + 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 == project_blob_path(@project, "markdown/doc/api/README.md") + 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 == project_blob_path(@project, "markdown/doc/api/README.md") + 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 == project_tree_path(@project, "markdown/doc/raketasks") + 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 == project_blob_path(@project, "markdown/doc/api/users.md") + 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 + project_tree_path(@project, "markdown") + 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 + project_blob_path(@project, "markdown/README.md") + 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 + project_tree_path(@project, "markdown/d") + 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 + project_blob_path(@project, "markdown/d/README.md") + 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 + project_tree_path(@project, "markdown") + '#id' + 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 + project_tree_path(@project, "markdown") + '#id' + 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 + project_blob_path(@project, "markdown/README.md") + '#id' + 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 + project_blob_path(@project, "d/markdown/README.md") + '#id' + 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 + project_blob_path(@project, "markdown/README.md") + '#id' + 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 + project_blob_path(@project, "markdown/README.md") + '#id' + 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 == project_wiki_path(@project, "home") + current_path.should == namespace_project_wiki_path(@project.namespace, @project, "home") end step 'I add various links to the wiki page' do @@ -218,7 +218,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'Wiki page should have added links' do - current_path.should == project_wiki_path(@project, "home") + current_path.should == namespace_project_wiki_path(@project.namespace, @project, "home") page.should have_content "test GitLab API doc Rake tasks" end @@ -237,13 +237,13 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see new wiki page named test' do - current_path.should == project_wiki_path(@project, "test") + 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 project_wiki_path(@project, "home") - current_path.should == project_wiki_path(@project, "home") + 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 @@ -251,7 +251,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see Gitlab API document' do - current_path.should == project_wiki_path(@project, "api") + current_path.should == namespace_project_wiki_path(@project.namespace, @project, "api") page.should have_content "Editing" end @@ -260,13 +260,13 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see Rake tasks directory' do - current_path.should == project_wiki_path(@project, "raketasks") + 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 project_tree_path(@project, "markdown/doc/api") - current_path.should == project_tree_path(@project, "markdown/doc/api") + 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 @@ -274,7 +274,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see the correct markdown' do - current_path.should == project_blob_path(@project, "markdown/doc/api/users.md") + current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") page.should have_content "List users" end |