Commit f40e0171db1fd15bdfa87ea30a0a2a38834c7b01
1 parent
c0725188
Exists in
master
and in
4 other branches
Test if markdown is rendered properly.
Showing
5 changed files
with
228 additions
and
5 deletions
Show diff stats
@@ -0,0 +1,70 @@ | @@ -0,0 +1,70 @@ | ||
1 | +Feature: Project markdown render | ||
2 | + Background: | ||
3 | + Given I sign in as a user | ||
4 | + And I own project "Delta" | ||
5 | + Given I visit project source page | ||
6 | + | ||
7 | + Scenario: I browse files from master branch | ||
8 | + Then I should see files from repository in master | ||
9 | + And I should see rendered README which contains correct links | ||
10 | + And I click on Gitlab API in README | ||
11 | + Then I should see correct document rendered | ||
12 | + | ||
13 | + Scenario: I view README in master branch | ||
14 | + Then I should see files from repository in master | ||
15 | + And I should see rendered README which contains correct links | ||
16 | + And I click on Rake tasks in README | ||
17 | + Then I should see correct directory rendered | ||
18 | + | ||
19 | + Scenario: I navigate to doc directory to view documentation in master | ||
20 | + And I navigate to the doc/api/README | ||
21 | + And I see correct file rendered | ||
22 | + And I click on users in doc/api/README | ||
23 | + Then I should see the correct document file | ||
24 | + | ||
25 | + Scenario: I navigate to doc directory to view user doc in master | ||
26 | + And I navigate to the doc/api/README | ||
27 | + And I see correct file rendered | ||
28 | + And I click on raketasks in doc/api/README | ||
29 | + Then I should see correct directory rendered | ||
30 | + | ||
31 | + Scenario: I browse files from markdown branch | ||
32 | + When I visit markdown branch | ||
33 | + Then I should see files from repository in markdown branch | ||
34 | + And I should see rendered README which contains correct links | ||
35 | + And I click on Gitlab API in README | ||
36 | + Then I should see correct document rendered for markdown branch | ||
37 | + | ||
38 | + Scenario: I browse directory from markdown branch | ||
39 | + When I visit markdown branch | ||
40 | + Then I should see files from repository in markdown branch | ||
41 | + And I should see rendered README which contains correct links | ||
42 | + And I click on Rake tasks in README | ||
43 | + Then I should see correct directory rendered for markdown branch | ||
44 | + | ||
45 | + Scenario: I navigate to doc directory to view documentation in markdown branch | ||
46 | + When I visit markdown branch | ||
47 | + And I navigate to the doc/api/README | ||
48 | + And I see correct file rendered in markdown branch | ||
49 | + And I click on users in doc/api/README | ||
50 | + Then I should see the users document file in markdown branch | ||
51 | + | ||
52 | + Scenario: I navigate to doc directory to view user doc in markdown branch | ||
53 | + When I visit markdown branch | ||
54 | + And I navigate to the doc/api/README | ||
55 | + And I see correct file rendered in markdown branch | ||
56 | + And I click on raketasks in doc/api/README | ||
57 | + Then I should see correct directory rendered for markdown branch | ||
58 | + | ||
59 | + Scenario: I create a wiki page with different links | ||
60 | + Given I go to wiki page | ||
61 | + And I add various links to the wiki page | ||
62 | + Then Wiki page should have added links | ||
63 | + And I click on test link | ||
64 | + Then I see new wiki page named test | ||
65 | + When I go back to wiki page home | ||
66 | + And I click on GitLab API doc link | ||
67 | + Then I see Gitlab API document | ||
68 | + When I go back to wiki page home | ||
69 | + And I click on Rake tasks link | ||
70 | + Then I see Rake tasks directory |
@@ -0,0 +1,153 @@ | @@ -0,0 +1,153 @@ | ||
1 | +class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps | ||
2 | + include SharedAuthentication | ||
3 | + include SharedPaths | ||
4 | + | ||
5 | + And 'I own project "Delta"' do | ||
6 | + @project = Project.find_by_name "Delta" | ||
7 | + @project ||= create(:project_with_code, name: "Delta", namespace: @user.namespace) | ||
8 | + @project.team << [@user, :master] | ||
9 | + end | ||
10 | + | ||
11 | + Then 'I should see files from repository in master' do | ||
12 | + current_path.should == project_tree_path(@project, "master") | ||
13 | + page.should have_content "Gemfile" | ||
14 | + page.should have_content "app" | ||
15 | + page.should have_content "README" | ||
16 | + end | ||
17 | + | ||
18 | + And 'I should see rendered README which contains correct links' do | ||
19 | + page.should have_content "Welcome to GitLab GitLab is a free project and repository management application" | ||
20 | + page.should have_link "GitLab API doc" | ||
21 | + page.should have_link "GitLab API website" | ||
22 | + page.should have_link "Rake tasks" | ||
23 | + page.should have_link "backup and restore procedure" | ||
24 | + end | ||
25 | + | ||
26 | + And 'I click on Gitlab API in README' do | ||
27 | + click_link "GitLab API doc" | ||
28 | + end | ||
29 | + | ||
30 | + Then 'I should see correct document rendered' do | ||
31 | + current_path.should == project_blob_path(@project, "master/doc/api/README.md") | ||
32 | + page.should have_content "All API requests require authentication" | ||
33 | + end | ||
34 | + | ||
35 | + And 'I click on Rake tasks in README' do | ||
36 | + click_link "Rake tasks" | ||
37 | + end | ||
38 | + | ||
39 | + Then 'I should see correct directory rendered' do | ||
40 | + current_path.should == project_tree_path(@project, "master/doc/raketasks") | ||
41 | + page.should have_content "backup_restore.md" | ||
42 | + page.should have_content "maintenance.md" | ||
43 | + end | ||
44 | + | ||
45 | + And 'I navigate to the doc/api/README' do | ||
46 | + click_link "doc" | ||
47 | + click_link "api" | ||
48 | + click_link "README.md" | ||
49 | + end | ||
50 | + | ||
51 | + And 'I see correct file rendered' do | ||
52 | + current_path.should == project_blob_path(@project, "master/doc/api/README.md") | ||
53 | + page.should have_content "Contents" | ||
54 | + page.should have_link "Users" | ||
55 | + page.should have_link "Rake tasks" | ||
56 | + end | ||
57 | + | ||
58 | + And 'I click on users in doc/api/README' do | ||
59 | + click_link "Users" | ||
60 | + end | ||
61 | + | ||
62 | + Then 'I should see the correct document file' do | ||
63 | + current_path.should == project_blob_path(@project, "master/doc/api/users.md") | ||
64 | + page.should have_content "Get a list of users." | ||
65 | + end | ||
66 | + | ||
67 | + And 'I click on raketasks in doc/api/README' do | ||
68 | + click_link "Rake tasks" | ||
69 | + end | ||
70 | + | ||
71 | + When 'I visit markdown branch' do | ||
72 | + visit project_tree_path(@project, "markdown") | ||
73 | + end | ||
74 | + | ||
75 | + Then 'I should see files from repository in markdown branch' do | ||
76 | + current_path.should == project_tree_path(@project, "markdown") | ||
77 | + page.should have_content "Gemfile" | ||
78 | + page.should have_content "app" | ||
79 | + page.should have_content "README" | ||
80 | + end | ||
81 | + | ||
82 | + And 'I see correct file rendered in markdown branch' do | ||
83 | + current_path.should == project_blob_path(@project, "markdown/doc/api/README.md") | ||
84 | + page.should have_content "Contents" | ||
85 | + page.should have_link "Users" | ||
86 | + page.should have_link "Rake tasks" | ||
87 | + end | ||
88 | + | ||
89 | + Then 'I should see correct document rendered for markdown branch' do | ||
90 | + current_path.should == project_blob_path(@project, "markdown/doc/api/README.md") | ||
91 | + page.should have_content "All API requests require authentication" | ||
92 | + end | ||
93 | + | ||
94 | + Then 'I should see correct directory rendered for markdown branch' do | ||
95 | + current_path.should == project_tree_path(@project, "markdown/doc/raketasks") | ||
96 | + page.should have_content "backup_restore.md" | ||
97 | + page.should have_content "maintenance.md" | ||
98 | + end | ||
99 | + | ||
100 | + Then 'I should see the users document file in markdown branch' do | ||
101 | + current_path.should == project_blob_path(@project, "markdown/doc/api/users.md") | ||
102 | + page.should have_content "Get a list of users." | ||
103 | + end | ||
104 | + | ||
105 | + Given 'I go to wiki page' do | ||
106 | + click_link "Wiki" | ||
107 | + current_path.should == project_wiki_path(@project, "home") | ||
108 | + end | ||
109 | + | ||
110 | + And 'I add various links to the wiki page' do | ||
111 | + fill_in "wiki[content]", with: "[test](test)\n[GitLab API doc](doc/api/README.md)\n[Rake tasks](doc/raketasks)\n" | ||
112 | + fill_in "wiki[message]", with: "Adding links to wiki" | ||
113 | + click_button "Create page" | ||
114 | + end | ||
115 | + | ||
116 | + Then 'Wiki page should have added links' do | ||
117 | + current_path.should == project_wiki_path(@project, "home") | ||
118 | + page.should have_content "test GitLab API doc Rake tasks" | ||
119 | + end | ||
120 | + | ||
121 | + And 'I click on test link' do | ||
122 | + click_link "test" | ||
123 | + end | ||
124 | + | ||
125 | + Then 'I see new wiki page named test' do | ||
126 | + current_path.should == project_wiki_path(@project, "test") | ||
127 | + page.should have_content "Editing page" | ||
128 | + end | ||
129 | + | ||
130 | + When 'I go back to wiki page home' do | ||
131 | + visit project_wiki_path(@project, "home") | ||
132 | + current_path.should == project_wiki_path(@project, "home") | ||
133 | + end | ||
134 | + | ||
135 | + And 'I click on GitLab API doc link' do | ||
136 | + click_link "GitLab API" | ||
137 | + end | ||
138 | + | ||
139 | + Then 'I see Gitlab API document' do | ||
140 | + current_path.should == project_blob_path(@project, "master/doc/api/README.md") | ||
141 | + page.should have_content "Status codes" | ||
142 | + end | ||
143 | + | ||
144 | + And 'I click on Rake tasks link' do | ||
145 | + click_link "Rake tasks" | ||
146 | + end | ||
147 | + | ||
148 | + Then 'I see Rake tasks directory' do | ||
149 | + current_path.should == project_tree_path(@project, "master/doc/raketasks") | ||
150 | + page.should have_content "backup_restore.md" | ||
151 | + page.should have_content "maintenance.md" | ||
152 | + end | ||
153 | +end | ||
0 | \ No newline at end of file | 154 | \ No newline at end of file |
spec/lib/gitlab/satellite/merge_action_spec.rb
@@ -3,7 +3,7 @@ require 'spec_helper' | @@ -3,7 +3,7 @@ require 'spec_helper' | ||
3 | describe 'Gitlab::Satellite::MergeAction' do | 3 | describe 'Gitlab::Satellite::MergeAction' do |
4 | before(:each) do | 4 | before(:each) do |
5 | # TestEnv.init(mailer: false, init_repos: true, repos: true) | 5 | # TestEnv.init(mailer: false, init_repos: true, repos: true) |
6 | - @master = ['master', 'bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a'] | 6 | + @master = ['master', 'b1e6a9dbf1c85e6616497a5e7bad9143a4bd0828'] |
7 | @one_after_stable = ['stable', '6ea87c47f0f8a24ae031c3fff17bc913889ecd00'] #this commit sha is one after stable | 7 | @one_after_stable = ['stable', '6ea87c47f0f8a24ae031c3fff17bc913889ecd00'] #this commit sha is one after stable |
8 | @wiki_branch = ['wiki', '635d3e09b72232b6e92a38de6cc184147e5bcb41'] #this is the commit sha where the wiki branch goes off from master | 8 | @wiki_branch = ['wiki', '635d3e09b72232b6e92a38de6cc184147e5bcb41'] #this is the commit sha where the wiki branch goes off from master |
9 | @conflicting_metior = ['metior', '313d96e42b313a0af5ab50fa233bf43e27118b3f'] #this branch conflicts with the wiki branch | 9 | @conflicting_metior = ['metior', '313d96e42b313a0af5ab50fa233bf43e27118b3f'] #this branch conflicts with the wiki branch |
spec/models/project_spec.rb
@@ -132,17 +132,17 @@ describe Project do | @@ -132,17 +132,17 @@ describe Project do | ||
132 | 132 | ||
133 | it "should close merge request if last commit from source branch was pushed to target branch" do | 133 | it "should close merge request if last commit from source branch was pushed to target branch" do |
134 | @merge_request.reloaded_commits | 134 | @merge_request.reloaded_commits |
135 | - @merge_request.last_commit.id.should == "bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a" | ||
136 | - project.update_merge_requests("8716fc78f3c65bbf7bcf7b574febd583bc5d2812", "bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a", "refs/heads/stable", @key.user) | 135 | + @merge_request.last_commit.id.should == "b1e6a9dbf1c85e6616497a5e7bad9143a4bd0828" |
136 | + project.update_merge_requests("8716fc78f3c65bbf7bcf7b574febd583bc5d2812", "b1e6a9dbf1c85e6616497a5e7bad9143a4bd0828", "refs/heads/stable", @key.user) | ||
137 | @merge_request.reload | 137 | @merge_request.reload |
138 | @merge_request.merged?.should be_true | 138 | @merge_request.merged?.should be_true |
139 | end | 139 | end |
140 | 140 | ||
141 | it "should update merge request commits with new one if pushed to source branch" do | 141 | it "should update merge request commits with new one if pushed to source branch" do |
142 | @merge_request.last_commit.should == nil | 142 | @merge_request.last_commit.should == nil |
143 | - project.update_merge_requests("8716fc78f3c65bbf7bcf7b574febd583bc5d2812", "bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a", "refs/heads/master", @key.user) | 143 | + project.update_merge_requests("8716fc78f3c65bbf7bcf7b574febd583bc5d2812", "b1e6a9dbf1c85e6616497a5e7bad9143a4bd0828", "refs/heads/master", @key.user) |
144 | @merge_request.reload | 144 | @merge_request.reload |
145 | - @merge_request.last_commit.id.should == "bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a" | 145 | + @merge_request.last_commit.id.should == "b1e6a9dbf1c85e6616497a5e7bad9143a4bd0828" |
146 | end | 146 | end |
147 | end | 147 | end |
148 | 148 |
spec/seed_project.tar.gz
No preview for this file type