Commit c7a64311b198081b94cde4214e0509d15fb79130
1 parent
f77918c3
Exists in
master
and in
4 other branches
Cleanup gfm tests
Showing
1 changed file
with
3 additions
and
72 deletions
Show diff stats
spec/features/gitlab_flavored_markdown_spec.rb
| @@ -11,29 +11,10 @@ describe "Gitlab Flavored Markdown" do | @@ -11,29 +11,10 @@ describe "Gitlab Flavored Markdown" do | ||
| 11 | end | 11 | end |
| 12 | 12 | ||
| 13 | before do | 13 | before do |
| 14 | - # add test branch | ||
| 15 | - @branch_name = "gfm-test" | ||
| 16 | - r = project.repo | ||
| 17 | - i = r.index | ||
| 18 | - # add test file | ||
| 19 | - @test_file = "gfm_test_file" | ||
| 20 | - i.add(@test_file, "foo\nbar\n") | ||
| 21 | - # add commit with gfm | ||
| 22 | - i.commit("fix ##{issue.id}\n\nask @#{fred.username} for details", head: @branch_name) | ||
| 23 | - | ||
| 24 | - # add test tag | ||
| 25 | - @tag_name = "gfm-test-tag" | ||
| 26 | - r.git.native(:tag, {}, @tag_name, commit.id) | 14 | + Commit.any_instance.stub(title: "fix ##{issue.id}\n\nask @#{fred.username} for details") |
| 27 | end | 15 | end |
| 28 | 16 | ||
| 29 | - after do | ||
| 30 | - # delete test branch and tag | ||
| 31 | - project.repo.git.native(:branch, {D: true}, @branch_name) | ||
| 32 | - project.repo.git.native(:tag, {d: true}, @tag_name) | ||
| 33 | - project.repo.gc_auto | ||
| 34 | - end | ||
| 35 | - | ||
| 36 | - let(:commit) { project.repository.commits(@branch_name).first } | 17 | + let(:commit) { project.repository.commit } |
| 37 | 18 | ||
| 38 | before do | 19 | before do |
| 39 | login_as :user | 20 | login_as :user |
| @@ -42,7 +23,7 @@ describe "Gitlab Flavored Markdown" do | @@ -42,7 +23,7 @@ describe "Gitlab Flavored Markdown" do | ||
| 42 | 23 | ||
| 43 | describe "for commits" do | 24 | describe "for commits" do |
| 44 | it "should render title in commits#index" do | 25 | it "should render title in commits#index" do |
| 45 | - visit project_commits_path(project, @branch_name, limit: 1) | 26 | + visit project_commits_path(project, 'master', limit: 1) |
| 46 | 27 | ||
| 47 | page.should have_link("##{issue.id}") | 28 | page.should have_link("##{issue.id}") |
| 48 | end | 29 | end |
| @@ -59,23 +40,6 @@ describe "Gitlab Flavored Markdown" do | @@ -59,23 +40,6 @@ describe "Gitlab Flavored Markdown" do | ||
| 59 | page.should have_link("@#{fred.username}") | 40 | page.should have_link("@#{fred.username}") |
| 60 | end | 41 | end |
| 61 | 42 | ||
| 62 | - it "should render title in refs#tree", js: true do | ||
| 63 | - visit project_tree_path(project, @branch_name) | ||
| 64 | - | ||
| 65 | - within(".tree_commit") do | ||
| 66 | - page.should have_link("##{issue.id}") | ||
| 67 | - end | ||
| 68 | - end | ||
| 69 | - | ||
| 70 | - # @wip | ||
| 71 | - #it "should render title in refs#blame" do | ||
| 72 | - #visit project_blame_path(project, File.join(@branch_name, @test_file)) | ||
| 73 | - | ||
| 74 | - #within(".blame_commit") do | ||
| 75 | - #page.should have_link("##{issue.id}") | ||
| 76 | - #end | ||
| 77 | - #end | ||
| 78 | - | ||
| 79 | it "should render title in repositories#branches" do | 43 | it "should render title in repositories#branches" do |
| 80 | visit branches_project_repository_path(project) | 44 | visit branches_project_repository_path(project) |
| 81 | 45 | ||
| @@ -164,37 +128,4 @@ describe "Gitlab Flavored Markdown" do | @@ -164,37 +128,4 @@ describe "Gitlab Flavored Markdown" do | ||
| 164 | page.should have_link("@#{fred.username}") | 128 | page.should have_link("@#{fred.username}") |
| 165 | end | 129 | end |
| 166 | end | 130 | end |
| 167 | - | ||
| 168 | - | ||
| 169 | - describe "for notes" do | ||
| 170 | - it "should render in commits#show", js: true do | ||
| 171 | - visit project_commit_path(project, commit) | ||
| 172 | - within ".new_note.js-main-target-form" do | ||
| 173 | - fill_in "note_note", with: "see ##{issue.id}" | ||
| 174 | - click_button "Add Comment" | ||
| 175 | - end | ||
| 176 | - | ||
| 177 | - page.should have_link("##{issue.id}") | ||
| 178 | - end | ||
| 179 | - | ||
| 180 | - it "should render in issue#show", js: true do | ||
| 181 | - visit project_issue_path(project, issue) | ||
| 182 | - within ".new_note.js-main-target-form" do | ||
| 183 | - fill_in "note_note", with: "see ##{issue.id}" | ||
| 184 | - click_button "Add Comment" | ||
| 185 | - end | ||
| 186 | - | ||
| 187 | - page.should have_link("##{issue.id}") | ||
| 188 | - end | ||
| 189 | - | ||
| 190 | - it "should render in merge_request#show", js: true do | ||
| 191 | - visit project_merge_request_path(project, merge_request) | ||
| 192 | - within ".new_note.js-main-target-form" do | ||
| 193 | - fill_in "note_note", with: "see ##{issue.id}" | ||
| 194 | - click_button "Add Comment" | ||
| 195 | - end | ||
| 196 | - | ||
| 197 | - page.should have_link("##{issue.id}") | ||
| 198 | - end | ||
| 199 | - end | ||
| 200 | end | 131 | end |