Commit 08648212adf2a19f48419b76d1b78541cdd55610
Exists in
master
and in
1 other branch
Merge remote-tracking branch 'upstream/master' into github
Conflicts: Gemfile.lock
Showing
24 changed files
with
188 additions
and
165 deletions
Show diff stats
.travis.yml
Gemfile
1 | 1 | source 'http://rubygems.org' |
2 | 2 | |
3 | -gem 'rails', '3.0.10' | |
3 | +gem 'rails', '~> 3.2.0' | |
4 | + | |
4 | 5 | gem 'nokogiri' |
5 | 6 | gem 'mongoid', '~> 2.2.2' |
6 | 7 | |
... | ... | @@ -22,6 +23,7 @@ gem 'hoptoad_notifier', "~> 2.4" |
22 | 23 | gem 'actionmailer_inline_css', "~> 1.3.0" |
23 | 24 | gem 'kaminari' |
24 | 25 | gem 'rack-ssl-enforcer' |
26 | +gem 'fabrication', "~> 1.3.0" # Both for tests, and loading demo data | |
25 | 27 | |
26 | 28 | platform :ruby do |
27 | 29 | gem 'mongo', '= 1.3.1' |
... | ... | @@ -34,10 +36,9 @@ gem 'ri_cal' |
34 | 36 | group :development, :test do |
35 | 37 | gem 'rspec-rails', '~> 2.6' |
36 | 38 | gem 'webmock', :require => false |
37 | - gem 'fabrication' | |
38 | 39 | unless ENV['TRAVIS'] |
39 | 40 | gem 'ruby-debug', :platform => :mri_18 |
40 | - gem 'ruby-debug19', :platform => :mri_19, :require => 'ruby-debug' | |
41 | + # gem 'ruby-debug19', :platform => :mri_19, :require => 'ruby-debug' | |
41 | 42 | end |
42 | 43 | # gem 'rpm_contrib', :git => "git://github.com/bensymonds/rpm_contrib.git", :branch => "mongo-1.4.0_update" |
43 | 44 | end | ... | ... |
Gemfile.lock
... | ... | @@ -2,44 +2,43 @@ GEM |
2 | 2 | remote: http://rubygems.org/ |
3 | 3 | specs: |
4 | 4 | SystemTimer (1.2.3) |
5 | - abstract (1.0.0) | |
6 | - actionmailer (3.0.10) | |
7 | - actionpack (= 3.0.10) | |
8 | - mail (~> 2.2.19) | |
5 | + actionmailer (3.2.3) | |
6 | + actionpack (= 3.2.3) | |
7 | + mail (~> 2.4.4) | |
9 | 8 | actionmailer_inline_css (1.3.1) |
10 | 9 | actionmailer (>= 3.0.0) |
11 | 10 | nokogiri (>= 1.4.4) |
12 | 11 | premailer (>= 1.7.1) |
13 | - actionpack (3.0.10) | |
14 | - activemodel (= 3.0.10) | |
15 | - activesupport (= 3.0.10) | |
16 | - builder (~> 2.1.2) | |
17 | - erubis (~> 2.6.6) | |
18 | - i18n (~> 0.5.0) | |
19 | - rack (~> 1.2.1) | |
20 | - rack-mount (~> 0.6.14) | |
21 | - rack-test (~> 0.5.7) | |
22 | - tzinfo (~> 0.3.23) | |
23 | - activemodel (3.0.10) | |
24 | - activesupport (= 3.0.10) | |
25 | - builder (~> 2.1.2) | |
26 | - i18n (~> 0.5.0) | |
27 | - activerecord (3.0.10) | |
28 | - activemodel (= 3.0.10) | |
29 | - activesupport (= 3.0.10) | |
30 | - arel (~> 2.0.10) | |
31 | - tzinfo (~> 0.3.23) | |
32 | - activeresource (3.0.10) | |
33 | - activemodel (= 3.0.10) | |
34 | - activesupport (= 3.0.10) | |
35 | - activesupport (3.0.10) | |
36 | - addressable (2.2.7) | |
37 | - archive-tar-minitar (0.5.2) | |
38 | - arel (2.0.10) | |
12 | + actionpack (3.2.3) | |
13 | + activemodel (= 3.2.3) | |
14 | + activesupport (= 3.2.3) | |
15 | + builder (~> 3.0.0) | |
16 | + erubis (~> 2.7.0) | |
17 | + journey (~> 1.0.1) | |
18 | + rack (~> 1.4.0) | |
19 | + rack-cache (~> 1.2) | |
20 | + rack-test (~> 0.6.1) | |
21 | + sprockets (~> 2.1.2) | |
22 | + activemodel (3.2.3) | |
23 | + activesupport (= 3.2.3) | |
24 | + builder (~> 3.0.0) | |
25 | + activerecord (3.2.3) | |
26 | + activemodel (= 3.2.3) | |
27 | + activesupport (= 3.2.3) | |
28 | + arel (~> 3.0.2) | |
29 | + tzinfo (~> 0.3.29) | |
30 | + activeresource (3.2.3) | |
31 | + activemodel (= 3.2.3) | |
32 | + activesupport (= 3.2.3) | |
33 | + activesupport (3.2.3) | |
34 | + i18n (~> 0.6) | |
35 | + multi_json (~> 1.0) | |
36 | + addressable (2.2.8) | |
37 | + arel (3.0.2) | |
39 | 38 | bcrypt-ruby (3.0.1) |
40 | 39 | bson (1.3.1) |
41 | 40 | bson_ext (1.3.1) |
42 | - builder (2.1.2) | |
41 | + builder (3.0.0) | |
43 | 42 | capybara (1.1.2) |
44 | 43 | mime-types (>= 1.16) |
45 | 44 | nokogiri (>= 1.3.3) |
... | ... | @@ -47,14 +46,15 @@ GEM |
47 | 46 | rack-test (>= 0.5.4) |
48 | 47 | selenium-webdriver (~> 2.0) |
49 | 48 | xpath (~> 0.1.4) |
50 | - childprocess (0.3.1) | |
49 | + childprocess (0.3.2) | |
51 | 50 | ffi (~> 1.0.6) |
52 | - columnize (0.3.4) | |
51 | + columnize (0.3.6) | |
53 | 52 | crack (0.3.1) |
54 | - css_parser (1.2.5) | |
53 | + css_parser (1.2.6) | |
55 | 54 | addressable |
55 | + rdoc | |
56 | 56 | database_cleaner (0.6.7) |
57 | - devise (1.4.7) | |
57 | + devise (1.4.9) | |
58 | 58 | bcrypt-ruby (~> 3.0) |
59 | 59 | orm_adapter (~> 0.0.3) |
60 | 60 | warden (~> 1.0.3) |
... | ... | @@ -62,51 +62,54 @@ GEM |
62 | 62 | email_spec (1.2.1) |
63 | 63 | mail (~> 2.2) |
64 | 64 | rspec (~> 2.0) |
65 | - erubis (2.6.6) | |
66 | - abstract (>= 1.0.0) | |
67 | - fabrication (1.2.0) | |
68 | - faraday (0.7.4) | |
69 | - addressable (~> 2.2.6) | |
70 | - multipart-post (~> 1.1.0) | |
71 | - rack (>= 1.1.0, < 2) | |
72 | - faraday_middleware (0.8.6) | |
65 | + erubis (2.7.0) | |
66 | + fabrication (1.3.2) | |
67 | + faraday (0.7.6) | |
68 | + addressable (~> 2.2) | |
69 | + multipart-post (~> 1.1) | |
70 | + rack (~> 1.1) | |
71 | + faraday_middleware (0.8.7) | |
73 | 72 | faraday (>= 0.7.4, < 0.9) |
74 | 73 | ffi (1.0.11) |
75 | - haml (3.1.3) | |
74 | + haml (3.1.5) | |
76 | 75 | happymapper (0.4.0) |
77 | 76 | libxml-ruby (~> 2.0) |
78 | 77 | has_scope (0.5.1) |
79 | 78 | hashie (1.2.0) |
79 | + hike (1.2.1) | |
80 | 80 | hoptoad_notifier (2.4.11) |
81 | 81 | activesupport |
82 | 82 | builder |
83 | - htmlentities (4.3.0) | |
84 | - i18n (0.5.0) | |
85 | - inherited_resources (1.3.0) | |
83 | + htmlentities (4.3.1) | |
84 | + i18n (0.6.0) | |
85 | + inherited_resources (1.3.1) | |
86 | 86 | has_scope (~> 0.5.0) |
87 | - responders (~> 0.6.0) | |
88 | - kaminari (0.12.4) | |
89 | - rails (>= 3.0.0) | |
90 | - kgio (2.6.0) | |
87 | + responders (~> 0.6) | |
88 | + journey (1.0.3) | |
89 | + json (1.7.1) | |
90 | + kaminari (0.13.0) | |
91 | + actionpack (>= 3.0.0) | |
92 | + activesupport (>= 3.0.0) | |
93 | + railties (>= 3.0.0) | |
94 | + kgio (2.7.4) | |
91 | 95 | launchy (2.1.0) |
92 | 96 | addressable (~> 2.2.6) |
93 | - libxml-ruby (2.2.2) | |
97 | + libwebsocket (0.1.3) | |
98 | + addressable | |
99 | + libxml-ruby (2.3.2) | |
94 | 100 | lighthouse-api (2.0) |
95 | 101 | activeresource (>= 3.0.0) |
96 | 102 | activesupport (>= 3.0.0) |
97 | 103 | linecache (0.46) |
98 | 104 | rbx-require-relative (> 0.0.4) |
99 | - linecache19 (0.5.12) | |
100 | - ruby_core_source (>= 0.1.4) | |
101 | - mail (2.2.19) | |
102 | - activesupport (>= 2.3.6) | |
105 | + mail (2.4.4) | |
103 | 106 | i18n (>= 0.4.0) |
104 | 107 | mime-types (~> 1.16) |
105 | 108 | treetop (~> 1.4.8) |
106 | - mime-types (1.16) | |
109 | + mime-types (1.18) | |
107 | 110 | mongo (1.3.1) |
108 | 111 | bson (>= 1.3.1) |
109 | - mongoid (2.2.4) | |
112 | + mongoid (2.2.5) | |
110 | 113 | activemodel (~> 3.0) |
111 | 114 | mongo (~> 1.3) |
112 | 115 | tzinfo (~> 0.3.22) |
... | ... | @@ -115,9 +118,9 @@ GEM |
115 | 118 | bundler (>= 1.0.0) |
116 | 119 | rails (>= 3.0.0) |
117 | 120 | railties (>= 3.0.0) |
118 | - multi_json (1.1.0) | |
121 | + multi_json (1.0.4) | |
119 | 122 | multipart-post (1.1.5) |
120 | - nokogiri (1.5.0) | |
123 | + nokogiri (1.5.2) | |
121 | 124 | oa-core (0.3.2) |
122 | 125 | oauth2 (0.5.2) |
123 | 126 | faraday (~> 0.7) |
... | ... | @@ -137,10 +140,10 @@ GEM |
137 | 140 | omniauth-oauth2 (1.0.0) |
138 | 141 | oauth2 (~> 0.5.0) |
139 | 142 | omniauth (~> 1.0) |
140 | - orm_adapter (0.0.5) | |
143 | + orm_adapter (0.0.7) | |
141 | 144 | oruen_redmine_client (0.0.1) |
142 | 145 | activeresource (>= 2.3.0) |
143 | - pivotal-tracker (0.4.1) | |
146 | + pivotal-tracker (0.5.4) | |
144 | 147 | builder |
145 | 148 | builder |
146 | 149 | happymapper (>= 0.3.2) |
... | ... | @@ -149,92 +152,89 @@ GEM |
149 | 152 | nokogiri (~> 1.4) |
150 | 153 | rest-client (~> 1.6.0) |
151 | 154 | rest-client (~> 1.6.0) |
152 | - polyglot (0.3.2) | |
155 | + polyglot (0.3.3) | |
153 | 156 | premailer (1.7.3) |
154 | 157 | css_parser (>= 1.1.9) |
155 | 158 | htmlentities (>= 4.0.0) |
156 | - rack (1.2.5) | |
157 | - rack-mount (0.6.14) | |
158 | - rack (>= 1.0.0) | |
159 | + rack (1.4.1) | |
160 | + rack-cache (1.2) | |
161 | + rack (>= 0.4) | |
162 | + rack-ssl (1.3.2) | |
163 | + rack | |
159 | 164 | rack-ssl-enforcer (0.2.4) |
160 | - rack-test (0.5.7) | |
165 | + rack-test (0.6.1) | |
161 | 166 | rack (>= 1.0) |
162 | - rails (3.0.10) | |
163 | - actionmailer (= 3.0.10) | |
164 | - actionpack (= 3.0.10) | |
165 | - activerecord (= 3.0.10) | |
166 | - activeresource (= 3.0.10) | |
167 | - activesupport (= 3.0.10) | |
167 | + rails (3.2.3) | |
168 | + actionmailer (= 3.2.3) | |
169 | + actionpack (= 3.2.3) | |
170 | + activerecord (= 3.2.3) | |
171 | + activeresource (= 3.2.3) | |
172 | + activesupport (= 3.2.3) | |
168 | 173 | bundler (~> 1.0) |
169 | - railties (= 3.0.10) | |
170 | - railties (3.0.10) | |
171 | - actionpack (= 3.0.10) | |
172 | - activesupport (= 3.0.10) | |
174 | + railties (= 3.2.3) | |
175 | + railties (3.2.3) | |
176 | + actionpack (= 3.2.3) | |
177 | + activesupport (= 3.2.3) | |
178 | + rack-ssl (~> 1.3.2) | |
173 | 179 | rake (>= 0.8.7) |
174 | 180 | rdoc (~> 3.4) |
175 | - thor (~> 0.14.4) | |
181 | + thor (~> 0.14.6) | |
176 | 182 | raindrops (0.8.0) |
177 | - rake (0.9.2) | |
178 | - rbx-require-relative (0.0.5) | |
179 | - rdoc (3.9.4) | |
180 | - responders (0.6.4) | |
183 | + rake (0.9.2.2) | |
184 | + rbx-require-relative (0.0.9) | |
185 | + rdoc (3.12) | |
186 | + json (~> 1.4) | |
187 | + responders (0.9.1) | |
188 | + railties (~> 3.1) | |
181 | 189 | rest-client (1.6.7) |
182 | 190 | mime-types (>= 1.16) |
183 | 191 | ri_cal (0.8.8) |
184 | - rspec (2.6.0) | |
185 | - rspec-core (~> 2.6.0) | |
186 | - rspec-expectations (~> 2.6.0) | |
187 | - rspec-mocks (~> 2.6.0) | |
188 | - rspec-core (2.6.4) | |
189 | - rspec-expectations (2.6.0) | |
190 | - diff-lcs (~> 1.1.2) | |
191 | - rspec-mocks (2.6.0) | |
192 | - rspec-rails (2.6.1) | |
193 | - actionpack (~> 3.0) | |
194 | - activesupport (~> 3.0) | |
195 | - railties (~> 3.0) | |
196 | - rspec (~> 2.6.0) | |
192 | + rspec (2.10.0) | |
193 | + rspec-core (~> 2.10.0) | |
194 | + rspec-expectations (~> 2.10.0) | |
195 | + rspec-mocks (~> 2.10.0) | |
196 | + rspec-core (2.10.0) | |
197 | + rspec-expectations (2.10.0) | |
198 | + diff-lcs (~> 1.1.3) | |
199 | + rspec-mocks (2.10.1) | |
200 | + rspec-rails (2.10.1) | |
201 | + actionpack (>= 3.0) | |
202 | + activesupport (>= 3.0) | |
203 | + railties (>= 3.0) | |
204 | + rspec (~> 2.10.0) | |
197 | 205 | ruby-debug (0.10.4) |
198 | 206 | columnize (>= 0.1) |
199 | 207 | ruby-debug-base (~> 0.10.4.0) |
200 | 208 | ruby-debug-base (0.10.4) |
201 | 209 | linecache (>= 0.3) |
202 | - ruby-debug-base19 (0.11.25) | |
203 | - columnize (>= 0.3.1) | |
204 | - linecache19 (>= 0.5.11) | |
205 | - ruby_core_source (>= 0.1.4) | |
206 | - ruby-debug19 (0.11.6) | |
207 | - columnize (>= 0.3.1) | |
208 | - linecache19 (>= 0.5.11) | |
209 | - ruby-debug-base19 (>= 0.11.19) | |
210 | - ruby-fogbugz (0.0.4) | |
210 | + ruby-fogbugz (0.1.1) | |
211 | 211 | crack |
212 | - typhoeus | |
213 | - ruby_core_source (0.1.5) | |
214 | - archive-tar-minitar (>= 0.5.2) | |
215 | - rubyzip (0.9.6.1) | |
216 | - selenium-webdriver (2.20.0) | |
212 | + rubyzip (0.9.8) | |
213 | + selenium-webdriver (2.21.2) | |
217 | 214 | childprocess (>= 0.2.5) |
218 | 215 | ffi (~> 1.0) |
216 | + libwebsocket (~> 0.1.3) | |
219 | 217 | multi_json (~> 1.0) |
220 | 218 | rubyzip |
219 | + sprockets (2.1.3) | |
220 | + hike (~> 1.2) | |
221 | + rack (~> 1.0) | |
222 | + tilt (~> 1.1, != 1.3.0) | |
221 | 223 | thor (0.14.6) |
224 | + tilt (1.3.3) | |
222 | 225 | treetop (1.4.10) |
223 | 226 | polyglot |
224 | 227 | polyglot (>= 0.3.1) |
225 | - typhoeus (0.2.4) | |
226 | - mime-types | |
227 | - mime-types | |
228 | - tzinfo (0.3.30) | |
229 | - unicorn (4.1.1) | |
230 | - kgio (~> 2.4) | |
228 | + tzinfo (0.3.33) | |
229 | + unicorn (4.3.1) | |
230 | + kgio (~> 2.6) | |
231 | 231 | rack |
232 | - raindrops (~> 0.6) | |
232 | + raindrops (~> 0.7) | |
233 | 233 | useragent (0.3.2) |
234 | - warden (1.0.5) | |
234 | + warden (1.0.6) | |
235 | 235 | rack (>= 1.0) |
236 | - webmock (1.7.6) | |
237 | - addressable (~> 2.2, > 2.2.5) | |
236 | + webmock (1.8.6) | |
237 | + addressable (>= 2.2.7) | |
238 | 238 | crack (>= 0.1.7) |
239 | 239 | xpath (0.1.4) |
240 | 240 | nokogiri (~> 1.3) |
... | ... | @@ -251,7 +251,7 @@ DEPENDENCIES |
251 | 251 | database_cleaner (~> 0.6.0) |
252 | 252 | devise (~> 1.4.0) |
253 | 253 | email_spec |
254 | - fabrication | |
254 | + fabrication (~> 1.3.0) | |
255 | 255 | haml |
256 | 256 | hoptoad_notifier (~> 2.4) |
257 | 257 | htmlentities (~> 4.3.0) |
... | ... | @@ -269,12 +269,11 @@ DEPENDENCIES |
269 | 269 | oruen_redmine_client |
270 | 270 | pivotal-tracker |
271 | 271 | rack-ssl-enforcer |
272 | - rails (= 3.0.10) | |
272 | + rails (~> 3.2.0) | |
273 | 273 | ri_cal |
274 | 274 | rspec (~> 2.6) |
275 | 275 | rspec-rails (~> 2.6) |
276 | 276 | ruby-debug |
277 | - ruby-debug19 | |
278 | 277 | ruby-fogbugz |
279 | 278 | unicorn |
280 | 279 | useragent (~> 0.3.1) | ... | ... |
app/controllers/application_controller.rb
... | ... | @@ -8,7 +8,7 @@ class ApplicationController < ActionController::Base |
8 | 8 | # redirect to that app's path instead of the root path (apps#index). |
9 | 9 | def stored_location_for(resource) |
10 | 10 | location = super || root_path |
11 | - (location == root_path && App.count == 1) ? app_path(App.first) : location | |
11 | + (location == root_path && current_user.apps.count == 1) ? app_path(current_user.apps.first) : location | |
12 | 12 | end |
13 | 13 | |
14 | 14 | rescue_from ActionController::RedirectBackError, :with => :redirect_to_root |
... | ... | @@ -24,7 +24,7 @@ protected |
24 | 24 | def redirect_to_root |
25 | 25 | redirect_to(root_path) |
26 | 26 | end |
27 | - | |
27 | + | |
28 | 28 | def set_time_zone |
29 | 29 | Time.zone = current_user.time_zone if user_signed_in? |
30 | 30 | end | ... | ... |
app/models/app.rb
... | ... | @@ -14,12 +14,13 @@ class App |
14 | 14 | # Some legacy apps may have string as key instead of BSON::ObjectID |
15 | 15 | identity :type => String |
16 | 16 | |
17 | - # There seems to be a Mongoid bug making it impossible to use String identity with references_many feature: | |
18 | - # https://github.com/mongoid/mongoid/issues/703 | |
19 | - # Using 32 character string as a workaround. | |
20 | - before_create do |r| | |
21 | - r.id = ActiveSupport::SecureRandom.hex | |
22 | - end | |
17 | + # Bug fix | |
18 | + # # There seems to be a Mongoid bug making it impossible to use String identity with references_many feature: | |
19 | + # # https://github.com/mongoid/mongoid/issues/703 | |
20 | + # # Using 32 character string as a workaround. | |
21 | + # before_create do |r| | |
22 | + # r.id = ActiveSupport::SecureRandom.hex | |
23 | + # end | |
23 | 24 | |
24 | 25 | embeds_many :watchers |
25 | 26 | embeds_many :deploys |
... | ... | @@ -154,7 +155,7 @@ class App |
154 | 155 | end |
155 | 156 | |
156 | 157 | def generate_api_key |
157 | - self.api_key ||= ActiveSupport::SecureRandom.hex | |
158 | + self.api_key ||= SecureRandom.hex | |
158 | 159 | end |
159 | 160 | |
160 | 161 | def check_issue_tracker | ... | ... |
app/models/issue_trackers/lighthouse_tracker.rb
... | ... | @@ -23,7 +23,7 @@ class IssueTrackers::LighthouseTracker < IssueTracker |
23 | 23 | Lighthouse.token = api_token |
24 | 24 | # updating lighthouse account |
25 | 25 | Lighthouse::Ticket.site |
26 | - | |
26 | + Lighthouse::Ticket.format = :xml | |
27 | 27 | ticket = Lighthouse::Ticket.new(:project_id => project_id) |
28 | 28 | ticket.title = issue_title problem |
29 | 29 | ... | ... |
app/models/issue_trackers/redmine_tracker.rb
... | ... | @@ -31,6 +31,7 @@ class IssueTrackers::RedmineTracker < IssueTracker |
31 | 31 | RedmineClient::Base.configure do |
32 | 32 | self.token = token |
33 | 33 | self.site = acc |
34 | + self.format = :xml | |
34 | 35 | end |
35 | 36 | issue = RedmineClient::Issue.new(:project_id => project_id) |
36 | 37 | issue.subject = issue_title problem | ... | ... |
app/views/layouts/application.html.haml
... | ... | @@ -10,7 +10,7 @@ |
10 | 10 | = javascript_include_tag :defaults |
11 | 11 | = stylesheet_link_tag 'reset', 'application', 'jquery.alerts' |
12 | 12 | :css |
13 | - #{render :partial => "issue_trackers/icons.css"} | |
13 | + #{render :partial => "issue_trackers/icons", :formats => :css} | |
14 | 14 | |
15 | 15 | = yield :head |
16 | 16 | %body{:id => controller.controller_name, :class => controller.action_name} | ... | ... |
config/application.rb
... | ... | @@ -20,7 +20,7 @@ module Errbit |
20 | 20 | # -- all .rb files in that directory are automatically loaded. |
21 | 21 | |
22 | 22 | # Custom directories with classes and modules you want to be autoloadable. |
23 | - config.autoload_paths += [Rails.root.join("app/models/issue_trackers"), Rails.root.join('lib')] | |
23 | + config.autoload_paths += [Rails.root.join('lib')] | |
24 | 24 | |
25 | 25 | # Only load the plugins named here, in the order given (default is alphabetical). |
26 | 26 | # :all can be used as a placeholder for all plugins not explicitly named. | ... | ... |
config/environments/development.rb
... | ... | @@ -11,7 +11,6 @@ Errbit::Application.configure do |
11 | 11 | |
12 | 12 | # Show full error reports and disable caching |
13 | 13 | config.consider_all_requests_local = true |
14 | - config.action_view.debug_rjs = true | |
15 | 14 | config.action_controller.perform_caching = false |
16 | 15 | |
17 | 16 | # Don't care if the mailer can't send | ... | ... |
config/routes.rb
lib/issue_tracker_apis/mingle.rb
lib/tasks/errbit/bootstrap.rake
... | ... | @@ -7,7 +7,7 @@ namespace :errbit do |
7 | 7 | configs = { |
8 | 8 | 'config.example.yml' => 'config.yml', |
9 | 9 | 'deploy.example.rb' => 'deploy.rb', |
10 | - 'mongoid.example.yml' => 'mongoid.yml' | |
10 | + (ENV['HEROKU'] ? 'mongoid.mongohq.yml' : 'mongoid.example.yml') => 'mongoid.yml' | |
11 | 11 | } |
12 | 12 | |
13 | 13 | puts "Copying example config files..." | ... | ... |
... | ... | @@ -0,0 +1,26 @@ |
1 | +require 'spec_helper' | |
2 | + | |
3 | +describe Devise::SessionsController do | |
4 | + render_views | |
5 | + | |
6 | + describe "POST /users/sign_in" do | |
7 | + before do | |
8 | + @request.env["devise.mapping"] = Devise.mappings[:user] | |
9 | + end | |
10 | + | |
11 | + let(:app) { Fabricate(:app) } | |
12 | + let(:user) { Fabricate(:user) } | |
13 | + | |
14 | + it 'redirects to app index page if there are no apps for the user' do | |
15 | + post :create, { :user => { 'email' => user.email, 'password' => user.password } } | |
16 | + response.should redirect_to(root_path) | |
17 | + end | |
18 | + | |
19 | + it 'redirects to app page if there is app for the user' do | |
20 | + Fabricate(:user_watcher, :app => app, :user => user) | |
21 | + post :create, { :user => { 'email' => user.email, 'password' => user.password } } | |
22 | + response.should redirect_to(app_path(app)) | |
23 | + end | |
24 | + end | |
25 | +end | |
26 | + | ... | ... |
spec/fabricators/app_fabricator.rb
spec/fabricators/err_fabricator.rb
... | ... | @@ -19,7 +19,7 @@ def random_backtrace |
19 | 19 | backtrace = [] |
20 | 20 | 99.times {|t| backtrace << { |
21 | 21 | 'number' => rand(999), |
22 | - 'file' => "/path/to/file/#{ActiveSupport::SecureRandom.hex(4)}.rb", | |
22 | + 'file' => "/path/to/file/#{SecureRandom.hex(4)}.rb", | |
23 | 23 | 'method' => ActiveSupport.methods.shuffle.first |
24 | 24 | }} |
25 | 25 | backtrace | ... | ... |
spec/fabricators/issue_tracker_fabricator.rb
... | ... | @@ -8,19 +8,19 @@ Fabricator :issue_tracker do |
8 | 8 | end |
9 | 9 | |
10 | 10 | %w(lighthouse pivotal_labs fogbugz).each do |t| |
11 | - Fabricator "#{t}_tracker".to_sym, :from => :issue_tracker, :class_name => "#{t}_tracker".to_sym | |
11 | + Fabricator "#{t}_tracker".to_sym, :from => :issue_tracker, :class_name => "IssueTrackers::#{t.camelcase}Tracker" | |
12 | 12 | end |
13 | 13 | |
14 | -Fabricator :redmine_tracker, :from => :issue_tracker, :class_name => :redmine_tracker do | |
14 | +Fabricator :redmine_tracker, :from => :issue_tracker, :class_name => "IssueTrackers::RedmineTracker" do | |
15 | 15 | account 'http://redmine.example.com' |
16 | 16 | end |
17 | 17 | |
18 | -Fabricator :mingle_tracker, :from => :issue_tracker, :class_name => :mingle_tracker do | |
18 | +Fabricator :mingle_tracker, :from => :issue_tracker, :class_name => "IssueTrackers::MingleTracker" do | |
19 | 19 | account 'https://mingle.example.com' |
20 | 20 | ticket_properties 'card_type = Defect, defect_status = open, priority = essential' |
21 | 21 | end |
22 | 22 | |
23 | -Fabricator :github_issues_tracker, :from => :issue_tracker, :class_name => :github_issues_tracker do | |
23 | +Fabricator :github_issues_tracker, :from => :issue_tracker, :class_name => "IssueTrackers::GithubIssuesTracker" do | |
24 | 24 | project_id 'test_account/test_project' |
25 | 25 | username 'test_username' |
26 | 26 | end | ... | ... |
spec/models/issue_trackers/fogbugz_tracker_spec.rb
1 | 1 | require 'spec_helper' |
2 | 2 | |
3 | -describe FogbugzTracker do | |
3 | +describe IssueTrackers::FogbugzTracker do | |
4 | 4 | it "should create an issue on Fogbugz with problem params, and set issue link for problem" do |
5 | 5 | notice = Fabricate :notice |
6 | 6 | tracker = Fabricate :fogbugz_tracker, :app => notice.app | ... | ... |
spec/models/issue_trackers/github_issues_tracker_spec.rb
1 | 1 | require 'spec_helper' |
2 | 2 | |
3 | -describe GithubIssuesTracker do | |
3 | +describe IssueTrackers::GithubIssuesTracker do | |
4 | 4 | it "should create an issue on Github Issues with problem params, and set issue link for problem" do |
5 | 5 | notice = Fabricate :notice |
6 | 6 | tracker = Fabricate :github_issues_tracker, :app => notice.app | ... | ... |
spec/models/issue_trackers/lighthouse_tracker_spec.rb
1 | 1 | require 'spec_helper' |
2 | 2 | |
3 | -describe LighthouseTracker do | |
3 | +describe IssueTrackers::LighthouseTracker do | |
4 | 4 | it "should create an issue on Lighthouse with problem params, and set issue link for problem" do |
5 | 5 | notice = Fabricate :notice |
6 | 6 | tracker = Fabricate :lighthouse_tracker, :app => notice.app | ... | ... |
spec/models/issue_trackers/mingle_tracker_spec.rb
spec/models/issue_trackers/pivotal_labs_tracker_spec.rb
1 | 1 | require 'spec_helper' |
2 | 2 | |
3 | -describe PivotalLabsTracker do | |
3 | +describe IssueTrackers::PivotalLabsTracker do | |
4 | 4 | it "should create an issue on Pivotal Tracker with problem params, and set issue link for problem" do |
5 | 5 | notice = Fabricate :notice |
6 | 6 | tracker = Fabricate :pivotal_labs_tracker, :app => notice.app, :project_id => 10 | ... | ... |
spec/models/issue_trackers/redmine_tracker_spec.rb
1 | 1 | require 'spec_helper' |
2 | 2 | |
3 | -describe RedmineTracker do | |
3 | +describe IssueTrackers::RedmineTracker do | |
4 | 4 | it "should create an issue on Redmine with problem params, and set issue link for problem" do |
5 | 5 | notice = Fabricate(:notice) |
6 | 6 | tracker = Fabricate(:redmine_tracker, :app => notice.app, :project_id => 10) | ... | ... |
spec/views/errs/show.html.haml_spec.rb
... | ... | @@ -17,7 +17,7 @@ describe "errs/show.html.haml" do |
17 | 17 | |
18 | 18 | it "should confirm the 'resolve' link by default" do |
19 | 19 | render |
20 | - action_bar = String.new(view.instance_variable_get(:@_content_for)[:action_bar]) | |
20 | + action_bar = String.new(view.view_flow.get(:action_bar)) | |
21 | 21 | resolve_link = action_bar.match(/(<a href.*?(class="resolve").*?>)/)[0] |
22 | 22 | resolve_link.should =~ /data-confirm="Seriously\?"/ |
23 | 23 | end |
... | ... | @@ -25,7 +25,7 @@ describe "errs/show.html.haml" do |
25 | 25 | it "should confirm the 'resolve' link if configuration is unset" do |
26 | 26 | Errbit::Config.stub(:confirm_resolve_err).and_return(nil) |
27 | 27 | render |
28 | - action_bar = String.new(view.instance_variable_get(:@_content_for)[:action_bar]) | |
28 | + action_bar = String.new(view.view_flow.get(:action_bar)) | |
29 | 29 | resolve_link = action_bar.match(/(<a href.*?(class="resolve").*?>)/)[0] |
30 | 30 | resolve_link.should =~ /data-confirm="Seriously\?"/ |
31 | 31 | end |
... | ... | @@ -33,7 +33,7 @@ describe "errs/show.html.haml" do |
33 | 33 | it "should not confirm the 'resolve' link if configured not to" do |
34 | 34 | Errbit::Config.stub(:confirm_resolve_err).and_return(false) |
35 | 35 | render |
36 | - action_bar = String.new(view.instance_variable_get(:@_content_for)[:action_bar]) | |
36 | + action_bar = String.new(view.view_flow.get(:action_bar)) | |
37 | 37 | resolve_link = action_bar.match(/(<a href.*?(class="resolve").*?>)/)[0] |
38 | 38 | resolve_link.should_not =~ /data-confirm=/ |
39 | 39 | end |
... | ... | @@ -42,7 +42,7 @@ describe "errs/show.html.haml" do |
42 | 42 | url = 'http://localhost:3000/errs' |
43 | 43 | controller.request.env['HTTP_REFERER'] = url |
44 | 44 | render |
45 | - action_bar = String.new(view.instance_variable_get(:@_content_for)[:action_bar]) | |
45 | + action_bar = String.new(view.view_flow.get(:action_bar)) | |
46 | 46 | action_bar.should =~ /<span><a href=\"#{url}\" class=\"up\">up<\/a><\/span>/ |
47 | 47 | end |
48 | 48 | |
... | ... | @@ -52,7 +52,7 @@ describe "errs/show.html.haml" do |
52 | 52 | assign :problem, problem |
53 | 53 | assign :app, problem.app |
54 | 54 | render |
55 | - action_bar = String.new(view.instance_variable_get(:@_content_for)[:action_bar]) | |
55 | + action_bar = String.new(view.view_flow.get(:action_bar)) | |
56 | 56 | action_bar.should =~ /<span><a href=\"#{app_errs_path(problem.app)}\" class=\"up\">up<\/a><\/span>/ |
57 | 57 | end |
58 | 58 | |
... | ... | @@ -68,7 +68,7 @@ describe "errs/show.html.haml" do |
68 | 68 | assign :problem, problem |
69 | 69 | assign :app, problem.app |
70 | 70 | render |
71 | - comments_section = String.new(view.instance_variable_get(:@_content_for)[:comments]) | |
71 | + comments_section = String.new(view.view_flow.get(:comments)) | |
72 | 72 | comments_section.should =~ /Test comment/ |
73 | 73 | comments_section.should =~ /Add a comment/ |
74 | 74 | end |
... | ... | @@ -84,7 +84,7 @@ describe "errs/show.html.haml" do |
84 | 84 | problem = Fabricate(:problem) |
85 | 85 | with_issue_tracker(problem) |
86 | 86 | render |
87 | - view.instance_variable_get(:@_content_for)[:comments].should be_blank | |
87 | + view.view_flow.get(:comments).should be_blank | |
88 | 88 | end |
89 | 89 | |
90 | 90 | it 'should display existing comments' do |
... | ... | @@ -92,7 +92,7 @@ describe "errs/show.html.haml" do |
92 | 92 | problem.reload |
93 | 93 | with_issue_tracker(problem) |
94 | 94 | render |
95 | - comments_section = String.new(view.instance_variable_get(:@_content_for)[:comments]) | |
95 | + comments_section = String.new(view.view_flow.get(:comments)) | |
96 | 96 | comments_section.should =~ /Test comment/ |
97 | 97 | comments_section.should_not =~ /Add a comment/ |
98 | 98 | end | ... | ... |