diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2013-10-11 15:44:00 +0400 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2013-10-11 15:44:00 +0400 |
commit | f40e0171db1fd15bdfa87ea30a0a2a38834c7b01 (patch) | |
tree | c022454f22c534f1f928daa776c21e8f3519bdd8 /features | |
parent | c07251887c08553a2f734d7a18e6cfefad7a7084 (diff) |
Test if markdown is rendered properly.
Diffstat (limited to 'features')
-rw-r--r-- | features/project/source/markdown_render.feature | 70 | ||||
-rw-r--r-- | features/steps/project/project_markdown_render.rb | 153 |
2 files changed, 223 insertions, 0 deletions
diff --git a/features/project/source/markdown_render.feature b/features/project/source/markdown_render.feature new file mode 100644 index 00000000000..d461ae86c81 --- /dev/null +++ b/features/project/source/markdown_render.feature @@ -0,0 +1,70 @@ +Feature: Project markdown render + Background: + Given I sign in as a user + And I own project "Delta" + Given I visit project source page + + Scenario: I browse files from master branch + Then I should see files from repository in master + And I should see rendered README which contains correct links + And I click on Gitlab API in README + Then I should see correct document rendered + + Scenario: I view README in master branch + Then I should see files from repository in master + And I should see rendered README which contains correct links + And I click on Rake tasks in README + Then I should see correct directory rendered + + Scenario: I navigate to doc directory to view documentation in master + And I navigate to the doc/api/README + And I see correct file rendered + And I click on users in doc/api/README + Then I should see the correct document file + + Scenario: I navigate to doc directory to view user doc in master + And I navigate to the doc/api/README + And I see correct file rendered + And I click on raketasks in doc/api/README + Then I should see correct directory rendered + + Scenario: I browse files from markdown branch + When I visit markdown branch + Then I should see files from repository in markdown branch + And I should see rendered README which contains correct links + And I click on Gitlab API in README + Then I should see correct document rendered for markdown branch + + Scenario: I browse directory from markdown branch + When I visit markdown branch + Then I should see files from repository in markdown branch + And I should see rendered README which contains correct links + And I click on Rake tasks in README + Then I should see correct directory rendered for markdown branch + + Scenario: I navigate to doc directory to view documentation in markdown branch + When I visit markdown branch + And I navigate to the doc/api/README + And I see correct file rendered in markdown branch + And I click on users in doc/api/README + Then I should see the users document file in markdown branch + + Scenario: I navigate to doc directory to view user doc in markdown branch + When I visit markdown branch + And I navigate to the doc/api/README + And I see correct file rendered in markdown branch + And I click on raketasks in doc/api/README + Then I should see correct directory rendered for markdown branch + + Scenario: I create a wiki page with different links + Given I go to wiki page + And I add various links to the wiki page + Then Wiki page should have added links + And I click on test link + Then I see new wiki page named test + When I go back to wiki page home + And I click on GitLab API doc link + Then I see Gitlab API document + When I go back to wiki page home + And I click on Rake tasks link + Then I see Rake tasks directory diff --git a/features/steps/project/project_markdown_render.rb b/features/steps/project/project_markdown_render.rb new file mode 100644 index 00000000000..11a3ff9d0cb --- /dev/null +++ b/features/steps/project/project_markdown_render.rb @@ -0,0 +1,153 @@ +class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps + include SharedAuthentication + include SharedPaths + + And 'I own project "Delta"' do + @project = Project.find_by_name "Delta" + @project ||= create(:project_with_code, name: "Delta", namespace: @user.namespace) + @project.team << [@user, :master] + end + + Then 'I should see files from repository in master' do + current_path.should == project_tree_path(@project, "master") + page.should have_content "Gemfile" + page.should have_content "app" + page.should have_content "README" + end + + And '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" + end + + And 'I click on Gitlab API in README' do + click_link "GitLab API doc" + end + + Then 'I should see correct document rendered' do + current_path.should == project_blob_path(@project, "master/doc/api/README.md") + page.should have_content "All API requests require authentication" + end + + And 'I click on Rake tasks in README' do + click_link "Rake tasks" + end + + Then 'I should see correct directory rendered' do + current_path.should == project_tree_path(@project, "master/doc/raketasks") + page.should have_content "backup_restore.md" + page.should have_content "maintenance.md" + end + + And '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 + current_path.should == project_blob_path(@project, "master/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 + click_link "Users" + end + + Then 'I should see the correct document file' do + current_path.should == project_blob_path(@project, "master/doc/api/users.md") + page.should have_content "Get a list of users." + end + + And 'I click on raketasks in doc/api/README' do + click_link "Rake tasks" + end + + When 'I visit markdown branch' do + visit project_tree_path(@project, "markdown") + end + + Then 'I should see files from repository in markdown branch' do + current_path.should == project_tree_path(@project, "markdown") + page.should have_content "Gemfile" + page.should have_content "app" + page.should have_content "README" + end + + And '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 + 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 + 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 + current_path.should == project_blob_path(@project, "markdown/doc/api/users.md") + page.should have_content "Get a list of users." + end + + Given '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 + fill_in "wiki[content]", with: "[test](test)\n[GitLab API doc](doc/api/README.md)\n[Rake tasks](doc/raketasks)\n" + fill_in "wiki[message]", with: "Adding links to wiki" + click_button "Create page" + end + + Then '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 + + And 'I click on test link' do + click_link "test" + end + + Then 'I see new wiki page named test' do + current_path.should == project_wiki_path(@project, "test") + page.should have_content "Editing page" + end + + When 'I go back to wiki page home' do + visit project_wiki_path(@project, "home") + current_path.should == project_wiki_path(@project, "home") + end + + And 'I click on GitLab API doc link' do + click_link "GitLab API" + end + + Then 'I see Gitlab API document' do + current_path.should == project_blob_path(@project, "master/doc/api/README.md") + page.should have_content "Status codes" + end + + And 'I click on Rake tasks link' do + click_link "Rake tasks" + end + + Then 'I see Rake tasks directory' do + current_path.should == project_tree_path(@project, "master/doc/raketasks") + page.should have_content "backup_restore.md" + page.should have_content "maintenance.md" + end +end
\ No newline at end of file |