File tree 5 files changed +51
-4
lines changed
5 files changed +51
-4
lines changed Original file line number Diff line number Diff line change
1
+ # == Schema Information
2
+ #
3
+ # Table name: services
4
+ #
5
+ # id :integer not null, primary key
6
+ # type :string(255)
7
+ # title :string(255)
8
+ # token :string(255)
9
+ # project_id :integer not null
10
+ # created_at :datetime not null
11
+ # updated_at :datetime not null
12
+ # active :boolean default(FALSE), not null
13
+ # project_url :string(255)
14
+ #
15
+
16
+ require 'spec_helper'
17
+
18
+ describe GitlabCiService do
19
+ describe "Associations" do
20
+ it { should belong_to :project }
21
+ it { should have_one :service_hook }
22
+ end
23
+
24
+ describe "Mass assignment" do
25
+ it { should_not allow_mass_assignment_of ( :project_id ) }
26
+ end
27
+
28
+ describe 'commits methods' do
29
+ before do
30
+ @service = GitlabCiService . new
31
+ @service . stub (
32
+ service_hook : true ,
33
+ project_url : 'http://ci.gitlab.org/projects/2' ,
34
+ token : 'verySecret'
35
+ )
36
+ end
37
+
38
+ describe :commit_badge_path do
39
+ it { @service . commit_badge_path ( "2ab7834c" ) . should == "http://ci.gitlab.org/projects/2/status?sha=2ab7834c" }
40
+ end
41
+
42
+ describe :commit_status_path do
43
+ it { @service . commit_status_path ( "2ab7834c" ) . should == "http://ci.gitlab.org/projects/2/builds/2ab7834c/status.json?token=verySecret" }
44
+ end
45
+ end
46
+ end
Original file line number Diff line number Diff line change 33
33
end
34
34
35
35
describe 'modules' do
36
- it { should include_module ( IssueCommonality ) }
37
- it { should include_module ( Votes ) }
36
+ it { should include_module ( Issuable ) }
38
37
end
39
38
40
39
subject { create ( :issue ) }
Original file line number Diff line number Diff line change 33
33
end
34
34
35
35
describe 'modules' do
36
- it { should include_module ( IssueCommonality ) }
37
- it { should include_module ( Votes ) }
36
+ it { should include_module ( Issuable ) }
38
37
end
39
38
40
39
describe "#mr_and_commit_notes" do
Original file line number Diff line number Diff line change 40
40
end
41
41
42
42
it "should count closed issues" do
43
+ IssueObserver . current_user = issue . author
43
44
issue . update_attributes ( closed : true )
44
45
milestone . issues << issue
45
46
milestone . percent_complete . should == 100
Original file line number Diff line number Diff line change 162
162
163
163
describe 'filter' do
164
164
before do
165
+ User . delete_all
165
166
@user = create :user
166
167
@admin = create :user , admin : true
167
168
@blocked = create :user , blocked : true
175
176
176
177
describe :not_in_project do
177
178
before do
179
+ User . delete_all
178
180
@user = create :user
179
181
@project = create :project
180
182
end
You can’t perform that action at this time.
0 commit comments