Commit e9f1c39e7e258e58fa79a8646c3ad224119a0ae5

Authored by Dmitriy Zaporozhets
1 parent 9acaec7a

Fix tests

spec/features/gitlab_flavored_markdown_spec.rb
@@ -11,7 +11,7 @@ describe "GitLab Flavored Markdown" do @@ -11,7 +11,7 @@ describe "GitLab Flavored Markdown" do
11 end 11 end
12 12
13 before do 13 before do
14 - Commit.any_instance.stub(title: "fix ##{issue.id}\n\nask @#{fred.username} for details") 14 + Commit.any_instance.stub(title: "fix ##{issue.iid}\n\nask @#{fred.username} for details")
15 end 15 end
16 16
17 let(:commit) { project.repository.commit } 17 let(:commit) { project.repository.commit }
@@ -25,13 +25,13 @@ describe "GitLab Flavored Markdown" do @@ -25,13 +25,13 @@ describe "GitLab Flavored Markdown" do
25 it "should render title in commits#index" do 25 it "should render title in commits#index" do
26 visit project_commits_path(project, 'master', limit: 1) 26 visit project_commits_path(project, 'master', limit: 1)
27 27
28 - page.should have_link("##{issue.id}") 28 + page.should have_link("##{issue.iid}")
29 end 29 end
30 30
31 it "should render title in commits#show" do 31 it "should render title in commits#show" do
32 visit project_commit_path(project, commit) 32 visit project_commit_path(project, commit)
33 33
34 - page.should have_link("##{issue.id}") 34 + page.should have_link("##{issue.iid}")
35 end 35 end
36 36
37 it "should render description in commits#show" do 37 it "should render description in commits#show" do
@@ -43,7 +43,7 @@ describe "GitLab Flavored Markdown" do @@ -43,7 +43,7 @@ describe "GitLab Flavored Markdown" do
43 it "should render title in repositories#branches" do 43 it "should render title in repositories#branches" do
44 visit project_branches_path(project) 44 visit project_branches_path(project)
45 45
46 - page.should have_link("##{issue.id}") 46 + page.should have_link("##{issue.iid}")
47 end 47 end
48 end 48 end
49 49
@@ -57,20 +57,20 @@ describe "GitLab Flavored Markdown" do @@ -57,20 +57,20 @@ describe "GitLab Flavored Markdown" do
57 author: @user, 57 author: @user,
58 assignee: @user, 58 assignee: @user,
59 project: project, 59 project: project,
60 - title: "fix ##{@other_issue.id}", 60 + title: "fix ##{@other_issue.iid}",
61 description: "ask @#{fred.username} for details") 61 description: "ask @#{fred.username} for details")
62 end 62 end
63 63
64 it "should render subject in issues#index" do 64 it "should render subject in issues#index" do
65 visit project_issues_path(project) 65 visit project_issues_path(project)
66 66
67 - page.should have_link("##{@other_issue.id}") 67 + page.should have_link("##{@other_issue.iid}")
68 end 68 end
69 69
70 it "should render subject in issues#show" do 70 it "should render subject in issues#show" do
71 visit project_issue_path(project, @issue) 71 visit project_issue_path(project, @issue)
72 72
73 - page.should have_link("##{@other_issue.id}") 73 + page.should have_link("##{@other_issue.iid}")
74 end 74 end
75 75
76 it "should render details in issues#show" do 76 it "should render details in issues#show" do
@@ -83,19 +83,19 @@ describe "GitLab Flavored Markdown" do @@ -83,19 +83,19 @@ describe "GitLab Flavored Markdown" do
83 83
84 describe "for merge requests" do 84 describe "for merge requests" do
85 before do 85 before do
86 - @merge_request = create(:merge_request, source_project: project, target_project: project, title: "fix ##{issue.id}") 86 + @merge_request = create(:merge_request, source_project: project, target_project: project, title: "fix ##{issue.iid}")
87 end 87 end
88 88
89 it "should render title in merge_requests#index" do 89 it "should render title in merge_requests#index" do
90 visit project_merge_requests_path(project) 90 visit project_merge_requests_path(project)
91 91
92 - page.should have_link("##{issue.id}") 92 + page.should have_link("##{issue.iid}")
93 end 93 end
94 94
95 it "should render title in merge_requests#show" do 95 it "should render title in merge_requests#show" do
96 visit project_merge_request_path(project, @merge_request) 96 visit project_merge_request_path(project, @merge_request)
97 97
98 - page.should have_link("##{issue.id}") 98 + page.should have_link("##{issue.iid}")
99 end 99 end
100 end 100 end
101 101
@@ -104,20 +104,20 @@ describe "GitLab Flavored Markdown" do @@ -104,20 +104,20 @@ describe "GitLab Flavored Markdown" do
104 before do 104 before do
105 @milestone = create(:milestone, 105 @milestone = create(:milestone,
106 project: project, 106 project: project,
107 - title: "fix ##{issue.id}", 107 + title: "fix ##{issue.iid}",
108 description: "ask @#{fred.username} for details") 108 description: "ask @#{fred.username} for details")
109 end 109 end
110 110
111 it "should render title in milestones#index" do 111 it "should render title in milestones#index" do
112 visit project_milestones_path(project) 112 visit project_milestones_path(project)
113 113
114 - page.should have_link("##{issue.id}") 114 + page.should have_link("##{issue.iid}")
115 end 115 end
116 116
117 it "should render title in milestones#show" do 117 it "should render title in milestones#show" do
118 visit project_milestone_path(project, @milestone) 118 visit project_milestone_path(project, @milestone)
119 119
120 - page.should have_link("##{issue.id}") 120 + page.should have_link("##{issue.iid}")
121 end 121 end
122 122
123 it "should render description in milestones#show" do 123 it "should render description in milestones#show" do
spec/models/project_spec.rb
@@ -201,11 +201,11 @@ describe Project do @@ -201,11 +201,11 @@ describe Project do
201 let(:ext_project) { create(:redmine_project) } 201 let(:ext_project) { create(:redmine_project) }
202 202
203 it "should be true or if used internal tracker and issue exists" do 203 it "should be true or if used internal tracker and issue exists" do
204 - project.issue_exists?(existed_issue.id).should be_true 204 + project.issue_exists?(existed_issue.iid).should be_true
205 end 205 end
206 206
207 it "should be false or if used internal tracker and issue not exists" do 207 it "should be false or if used internal tracker and issue not exists" do
208 - project.issue_exists?(not_existed_issue.id).should be_false 208 + project.issue_exists?(not_existed_issue.iid).should be_false
209 end 209 end
210 210
211 it "should always be true if used other tracker" do 211 it "should always be true if used other tracker" do