summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-04-10 20:00:56 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-04-10 20:00:56 +0300
commitc7a64311b198081b94cde4214e0509d15fb79130 (patch)
treebc4ee18c37ec493bea580c70711e8fb80d2544e3 /spec
parentf77918c3afa25f73a18e1fb2963adb3d833771e3 (diff)
downloadgitlab-ce-c7a64311b198081b94cde4214e0509d15fb79130.tar.gz
Cleanup gfm tests
Diffstat (limited to 'spec')
-rw-r--r--spec/features/gitlab_flavored_markdown_spec.rb75
1 files changed, 3 insertions, 72 deletions
diff --git a/spec/features/gitlab_flavored_markdown_spec.rb b/spec/features/gitlab_flavored_markdown_spec.rb
index 653ff865175..aa72bcee005 100644
--- a/spec/features/gitlab_flavored_markdown_spec.rb
+++ b/spec/features/gitlab_flavored_markdown_spec.rb
@@ -11,29 +11,10 @@ describe "Gitlab Flavored Markdown" do
end
before do
- # add test branch
- @branch_name = "gfm-test"
- r = project.repo
- i = r.index
- # add test file
- @test_file = "gfm_test_file"
- i.add(@test_file, "foo\nbar\n")
- # add commit with gfm
- i.commit("fix ##{issue.id}\n\nask @#{fred.username} for details", head: @branch_name)
-
- # add test tag
- @tag_name = "gfm-test-tag"
- r.git.native(:tag, {}, @tag_name, commit.id)
+ Commit.any_instance.stub(title: "fix ##{issue.id}\n\nask @#{fred.username} for details")
end
- after do
- # delete test branch and tag
- project.repo.git.native(:branch, {D: true}, @branch_name)
- project.repo.git.native(:tag, {d: true}, @tag_name)
- project.repo.gc_auto
- end
-
- let(:commit) { project.repository.commits(@branch_name).first }
+ let(:commit) { project.repository.commit }
before do
login_as :user
@@ -42,7 +23,7 @@ describe "Gitlab Flavored Markdown" do
describe "for commits" do
it "should render title in commits#index" do
- visit project_commits_path(project, @branch_name, limit: 1)
+ visit project_commits_path(project, 'master', limit: 1)
page.should have_link("##{issue.id}")
end
@@ -59,23 +40,6 @@ describe "Gitlab Flavored Markdown" do
page.should have_link("@#{fred.username}")
end
- it "should render title in refs#tree", js: true do
- visit project_tree_path(project, @branch_name)
-
- within(".tree_commit") do
- page.should have_link("##{issue.id}")
- end
- end
-
- # @wip
- #it "should render title in refs#blame" do
- #visit project_blame_path(project, File.join(@branch_name, @test_file))
-
- #within(".blame_commit") do
- #page.should have_link("##{issue.id}")
- #end
- #end
-
it "should render title in repositories#branches" do
visit branches_project_repository_path(project)
@@ -164,37 +128,4 @@ describe "Gitlab Flavored Markdown" do
page.should have_link("@#{fred.username}")
end
end
-
-
- describe "for notes" do
- it "should render in commits#show", js: true do
- visit project_commit_path(project, commit)
- within ".new_note.js-main-target-form" do
- fill_in "note_note", with: "see ##{issue.id}"
- click_button "Add Comment"
- end
-
- page.should have_link("##{issue.id}")
- end
-
- it "should render in issue#show", js: true do
- visit project_issue_path(project, issue)
- within ".new_note.js-main-target-form" do
- fill_in "note_note", with: "see ##{issue.id}"
- click_button "Add Comment"
- end
-
- page.should have_link("##{issue.id}")
- end
-
- it "should render in merge_request#show", js: true do
- visit project_merge_request_path(project, merge_request)
- within ".new_note.js-main-target-form" do
- fill_in "note_note", with: "see ##{issue.id}"
- click_button "Add Comment"
- end
-
- page.should have_link("##{issue.id}")
- end
- end
end