diff options
Diffstat (limited to 'features/steps/project/markdown_render.rb')
-rw-r--r-- | features/steps/project/markdown_render.rb | 93 |
1 files changed, 48 insertions, 45 deletions
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 |