integrity 0.1.9.2 → 0.1.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +16 -2
- data/{README.markdown → README.md} +5 -2
- data/Rakefile +7 -29
- data/integrity.gemspec +9 -6
- data/lib/integrity.rb +4 -4
- data/lib/integrity/app.rb +1 -1
- data/lib/integrity/build.rb +9 -41
- data/lib/integrity/commit.rb +7 -18
- data/lib/integrity/helpers/breadcrumbs.rb +1 -1
- data/lib/integrity/helpers/forms.rb +7 -6
- data/lib/integrity/helpers/resources.rb +1 -1
- data/lib/integrity/installer.rb +6 -1
- data/lib/integrity/migrations.rb +13 -2
- data/lib/integrity/notifier.rb +16 -20
- data/lib/integrity/notifier/base.rb +7 -3
- data/lib/integrity/project.rb +10 -63
- data/lib/integrity/project/notifiers.rb +33 -0
- data/lib/integrity/project/push.rb +44 -0
- data/lib/integrity/project_builder.rb +35 -35
- data/test/acceptance/browse_project_test.rb +4 -0
- data/test/acceptance/build_notifications_test.rb +57 -4
- data/test/acceptance/installer_test.rb +4 -1
- data/test/helpers.rb +36 -40
- data/test/helpers/acceptance.rb +4 -0
- data/test/helpers/acceptance/notifier_helper.rb +47 -0
- data/test/unit/build_test.rb +21 -10
- data/test/unit/commit_test.rb +4 -21
- data/test/unit/helpers_test.rb +10 -6
- data/test/unit/migrations_test.rb +5 -4
- data/test/unit/notifier/base_test.rb +43 -0
- data/test/unit/notifier_test.rb +18 -49
- data/test/unit/project_builder_test.rb +8 -1
- data/test/unit/project_test.rb +95 -19
- data/views/_commit_info.haml +1 -1
- data/views/new.haml +1 -2
- metadata +19 -7
- data/test/acceptance/notifier_test.rb +0 -109
- data/test/helpers/fixtures.rb +0 -87
data/views/_commit_info.haml
CHANGED
data/views/new.haml
CHANGED
@@ -29,8 +29,7 @@
|
|
29
29
|
%input.hidden{ :name => "project_data[public]", :value => "0", :type => "hidden" }
|
30
30
|
%input.checkbox#project_public{ checkbox("project_data[public]", @project.public?) }
|
31
31
|
|
32
|
-
-
|
33
|
-
= notifier_form(notifier)
|
32
|
+
- notifier_form
|
34
33
|
|
35
34
|
%p.submit
|
36
35
|
%button.positive{ :type => "submit" }= @project.new_record? ? "Create Project" : "Update Project"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: integrity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.9.
|
4
|
+
version: 0.1.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Nicol\xC3\xA1s Sanguinetti"
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-
|
13
|
+
date: 2009-04-06 00:00:00 +02:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -49,9 +49,9 @@ dependencies:
|
|
49
49
|
version_requirement:
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.9.
|
54
|
+
version: 0.9.11
|
55
55
|
version:
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: uuidtools
|
@@ -163,6 +163,16 @@ dependencies:
|
|
163
163
|
- !ruby/object:Gem::Version
|
164
164
|
version: "0"
|
165
165
|
version:
|
166
|
+
- !ruby/object:Gem::Dependency
|
167
|
+
name: jeremymcanally-matchy
|
168
|
+
type: :development
|
169
|
+
version_requirement:
|
170
|
+
version_requirements: !ruby/object:Gem::Requirement
|
171
|
+
requirements:
|
172
|
+
- - ">="
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: "0"
|
175
|
+
version:
|
166
176
|
- !ruby/object:Gem::Dependency
|
167
177
|
name: jeremymcanally-pending
|
168
178
|
type: :development
|
@@ -194,7 +204,7 @@ extra_rdoc_files: []
|
|
194
204
|
files:
|
195
205
|
- .gitignore
|
196
206
|
- CHANGES
|
197
|
-
- README.
|
207
|
+
- README.md
|
198
208
|
- Rakefile
|
199
209
|
- bin/integrity
|
200
210
|
- config/config.sample.ru
|
@@ -227,6 +237,8 @@ files:
|
|
227
237
|
- lib/integrity/notifier/test/fixtures.rb
|
228
238
|
- lib/integrity/notifier/test/hpricot_matcher.rb
|
229
239
|
- lib/integrity/project.rb
|
240
|
+
- lib/integrity/project/notifiers.rb
|
241
|
+
- lib/integrity/project/push.rb
|
230
242
|
- lib/integrity/project_builder.rb
|
231
243
|
- lib/integrity/scm.rb
|
232
244
|
- lib/integrity/scm/git.rb
|
@@ -245,7 +257,6 @@ files:
|
|
245
257
|
- test/acceptance/installer_test.rb
|
246
258
|
- test/acceptance/manual_build_project_test.rb
|
247
259
|
- test/acceptance/not_found_page_test.rb
|
248
|
-
- test/acceptance/notifier_test.rb
|
249
260
|
- test/acceptance/project_syndication_test.rb
|
250
261
|
- test/acceptance/stylesheet_test.rb
|
251
262
|
- test/acceptance/unauthorized_page_test.rb
|
@@ -253,19 +264,20 @@ files:
|
|
253
264
|
- test/helpers/acceptance.rb
|
254
265
|
- test/helpers/acceptance/email_notifier.rb
|
255
266
|
- test/helpers/acceptance/git_helper.rb
|
267
|
+
- test/helpers/acceptance/notifier_helper.rb
|
256
268
|
- test/helpers/acceptance/textfile_notifier.rb
|
257
269
|
- test/helpers/expectations.rb
|
258
270
|
- test/helpers/expectations/be_a.rb
|
259
271
|
- test/helpers/expectations/change.rb
|
260
272
|
- test/helpers/expectations/have.rb
|
261
273
|
- test/helpers/expectations/predicates.rb
|
262
|
-
- test/helpers/fixtures.rb
|
263
274
|
- test/helpers/initial_migration_fixture.sql
|
264
275
|
- test/unit/build_test.rb
|
265
276
|
- test/unit/commit_test.rb
|
266
277
|
- test/unit/helpers_test.rb
|
267
278
|
- test/unit/integrity_test.rb
|
268
279
|
- test/unit/migrations_test.rb
|
280
|
+
- test/unit/notifier/base_test.rb
|
269
281
|
- test/unit/notifier/test_test.rb
|
270
282
|
- test/unit/notifier_test.rb
|
271
283
|
- test/unit/project_builder_test.rb
|
@@ -1,109 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + "/../helpers/acceptance"
|
2
|
-
|
3
|
-
class NotifierConfigIssues < Test::Unit::AcceptanceTestCase
|
4
|
-
story <<-EOS
|
5
|
-
As an administrator,
|
6
|
-
I want to add multiple projects to Integrity,
|
7
|
-
So that I can be certain notifiers remain functional (cf #43)
|
8
|
-
EOS
|
9
|
-
|
10
|
-
before(:each) do
|
11
|
-
# This is needed before any available notifier is unset
|
12
|
-
# in the global #before
|
13
|
-
load File.dirname(__FILE__) + "/../helpers/acceptance/email_notifier.rb"
|
14
|
-
end
|
15
|
-
|
16
|
-
def fill_in_email_notifier
|
17
|
-
fill_in "notifiers[Email][to]", :with => "quentin@example.com"
|
18
|
-
fill_in "notifiers[Email][from]", :with => "ci@example.com"
|
19
|
-
fill_in "notifiers[Email][user]", :with => "inspector"
|
20
|
-
fill_in "notifiers[Email][pass]", :with => "gadget"
|
21
|
-
fill_in "notifiers[Email][auth]", :with => "simple"
|
22
|
-
fill_in "notifiers[Email][domain]", :with => "example.com"
|
23
|
-
end
|
24
|
-
|
25
|
-
def fill_in_project_info(name, repo)
|
26
|
-
fill_in "Name", :with => name
|
27
|
-
fill_in "Git repository", :with => repo
|
28
|
-
fill_in "Branch to track", :with => "master"
|
29
|
-
fill_in "Build script", :with => "rake"
|
30
|
-
check "Public project"
|
31
|
-
|
32
|
-
fill_in_email_notifier
|
33
|
-
end
|
34
|
-
|
35
|
-
def assert_have_email_notifier
|
36
|
-
assert_have_tag "input#email_notifier_to[@value='quentin@example.com']"
|
37
|
-
assert_have_tag "input#email_notifier_from[@value='ci@example.com']"
|
38
|
-
assert_have_tag "input#email_notifier_user[@value='inspector']"
|
39
|
-
assert_have_tag "input#email_notifier_pass[@value='gadget']"
|
40
|
-
assert_have_tag "input#email_notifier_auth[@value='simple']"
|
41
|
-
assert_have_tag "input#email_notifier_domain[@value='example.com']"
|
42
|
-
end
|
43
|
-
|
44
|
-
def add_project(name, repo)
|
45
|
-
visit "/new"
|
46
|
-
fill_in_project_info(name, repo)
|
47
|
-
click_button "Create Project"
|
48
|
-
|
49
|
-
assert_have_tag("h1", :content => name)
|
50
|
-
click_link 'Edit Project'
|
51
|
-
assert_have_email_notifier
|
52
|
-
end
|
53
|
-
|
54
|
-
def edit_project(name)
|
55
|
-
visit "/#{name}"
|
56
|
-
click_link "Edit Project"
|
57
|
-
assert_have_email_notifier
|
58
|
-
fill_in :branch, :with => "testing"
|
59
|
-
click_button "Update Project"
|
60
|
-
end
|
61
|
-
|
62
|
-
scenario "an admin can create a public project and retain mailer info" do
|
63
|
-
Project.first(:permalink => "integrity").should be_nil
|
64
|
-
|
65
|
-
login_as "admin", "test"
|
66
|
-
|
67
|
-
visit "/"
|
68
|
-
add_project "Integrity", "git://github.com/foca/integrity.git"
|
69
|
-
edit_project "integrity"
|
70
|
-
|
71
|
-
visit "/integrity"
|
72
|
-
click_link "Edit Project"
|
73
|
-
|
74
|
-
assert_have_email_notifier
|
75
|
-
end
|
76
|
-
|
77
|
-
scenario "an admin can create multiple public projects" do
|
78
|
-
Project.first(:permalink => "integrity").should be_nil
|
79
|
-
|
80
|
-
login_as "admin", "test"
|
81
|
-
|
82
|
-
visit "/"
|
83
|
-
|
84
|
-
add_project "Integrity", "git://github.com/foca/integrity.git"
|
85
|
-
click_link "projects"
|
86
|
-
|
87
|
-
add_project "Webrat", "git://github.com/brynary/webrat.git"
|
88
|
-
click_link "projects"
|
89
|
-
|
90
|
-
add_project "Rails", "git://github.com/rails/rails.git"
|
91
|
-
click_link "projects"
|
92
|
-
|
93
|
-
edit_project "integrity"
|
94
|
-
edit_project "webrat"
|
95
|
-
edit_project "rails"
|
96
|
-
|
97
|
-
visit "/integrity"
|
98
|
-
click_link "Edit Project"
|
99
|
-
assert_have_email_notifier
|
100
|
-
|
101
|
-
visit "/webrat"
|
102
|
-
click_link "Edit Project"
|
103
|
-
assert_have_email_notifier
|
104
|
-
|
105
|
-
visit "/rails"
|
106
|
-
click_link "Edit Project"
|
107
|
-
assert_have_email_notifier
|
108
|
-
end
|
109
|
-
end
|
data/test/helpers/fixtures.rb
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
Integrity::Project.fixture do
|
2
|
-
{ :name => (name = unique { /\w+/.gen }),
|
3
|
-
:uri => "git://github.com/#{/\w+/.gen}/#{name}.git",
|
4
|
-
:branch => ["master", "test-refactoring", "lh-34"].pick,
|
5
|
-
:command => ["rake", "make", "ant -buildfile test.xml"].pick,
|
6
|
-
:public => [true, false].pick,
|
7
|
-
:building => [true, false].pick }
|
8
|
-
end
|
9
|
-
|
10
|
-
Integrity::Project.fixture(:integrity) do
|
11
|
-
{ :name => "Integrity",
|
12
|
-
:uri => "git://github.com/foca/integrity.git",
|
13
|
-
:branch => "master",
|
14
|
-
:command => "rake",
|
15
|
-
:public => true,
|
16
|
-
:building => false }
|
17
|
-
end
|
18
|
-
|
19
|
-
Integrity::Project.fixture(:my_test_project) do
|
20
|
-
{ :name => "My Test Project",
|
21
|
-
:uri => File.dirname(__FILE__) + "/../../",
|
22
|
-
:branch => "master",
|
23
|
-
:command => "./test",
|
24
|
-
:public => true,
|
25
|
-
:building => false }
|
26
|
-
end
|
27
|
-
|
28
|
-
Integrity::Commit.fixture do
|
29
|
-
project = Integrity::Project.first || Integrity::Project.gen
|
30
|
-
|
31
|
-
{ :identifier => Digest::SHA1.hexdigest(/[:paragraph:]/.gen),
|
32
|
-
:message => /[:sentence:]/.gen,
|
33
|
-
:author => /\w+ \w+ <\w+@example.org>/.gen,
|
34
|
-
:committed_at => unique {|i| Time.mktime(2008, 12, 15, 18, (59 - i) % 60) },
|
35
|
-
:project_id => project.id }
|
36
|
-
end
|
37
|
-
|
38
|
-
Integrity::Commit.fixture(:successful) do
|
39
|
-
Integrity::Commit.generate_attributes.update(:build => Integrity::Build.gen(:successful))
|
40
|
-
end
|
41
|
-
|
42
|
-
Integrity::Commit.fixture(:failed) do
|
43
|
-
Integrity::Commit.generate_attributes.update(:build => Integrity::Build.gen(:failed))
|
44
|
-
end
|
45
|
-
|
46
|
-
Integrity::Commit.fixture(:pending) do
|
47
|
-
Integrity::Commit.generate_attributes.update(:build => Integrity::Build.gen(:pending))
|
48
|
-
end
|
49
|
-
|
50
|
-
Integrity::Build.fixture do
|
51
|
-
commit = Integrity::Commit.first || Integrity::Commit.gen
|
52
|
-
|
53
|
-
{ :output => /[:paragraph:]/.gen,
|
54
|
-
:successful => true,
|
55
|
-
:started_at => unique {|i| Time.mktime(2008, 12, 15, 18, i % 60) },
|
56
|
-
:created_at => unique {|i| Time.mktime(2008, 12, 15, 18, i % 60) },
|
57
|
-
:completed_at => unique {|i| Time.mktime(2008, 12, 15, 18, i % 60) },
|
58
|
-
:commit_id => commit.id }
|
59
|
-
end
|
60
|
-
|
61
|
-
Integrity::Build.fixture(:successful) do
|
62
|
-
Integrity::Build.generate_attributes.update(:successful => true)
|
63
|
-
end
|
64
|
-
|
65
|
-
Integrity::Build.fixture(:failed) do
|
66
|
-
Integrity::Build.generate_attributes.update(:successful => false)
|
67
|
-
end
|
68
|
-
|
69
|
-
Integrity::Build.fixture(:pending) do
|
70
|
-
Integrity::Build.generate_attributes.update(:successful => nil, :started_at => nil, :completed_at => nil)
|
71
|
-
end
|
72
|
-
|
73
|
-
Integrity::Notifier.fixture(:irc) do
|
74
|
-
create_notifier! "IRC"
|
75
|
-
|
76
|
-
{ :project => Integrity::Project.generate,
|
77
|
-
:name => "IRC",
|
78
|
-
:config => { :uri => "irc://irc.freenode.net/integrity" }}
|
79
|
-
end
|
80
|
-
|
81
|
-
Integrity::Notifier.fixture(:twitter) do
|
82
|
-
create_notifier! "Twitter"
|
83
|
-
|
84
|
-
{ :project => Integrity::Project.generate,
|
85
|
-
:name => "Twitter",
|
86
|
-
:config => { :email => "foo@example.org", :pass => "secret" }}
|
87
|
-
end
|