crowdblog 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/.travis.yml +8 -0
  2. data/Gemfile +5 -2
  3. data/Gemfile.lock +20 -37
  4. data/README.md +7 -0
  5. data/Rakefile +5 -2
  6. data/app/assets/javascripts/crowdblog/templates/posts/edit.jst.eco +1 -1
  7. data/app/controllers/crowdblog/application_controller.rb +1 -11
  8. data/app/controllers/crowdblog/sessions_controller.rb +1 -21
  9. data/app/models/crowdblog/post.rb +53 -44
  10. data/app/models/crowdblog/user.rb +9 -13
  11. data/app/views/layouts/crowdblog/application.html.slim +1 -0
  12. data/config/cucumber.yml +4 -3
  13. data/config/routes.rb +1 -2
  14. data/crowdblog.gemspec +6 -2
  15. data/features/posts/listing.feature +16 -0
  16. data/features/posts/manage.feature +31 -0
  17. data/features/posts/publish.feature +17 -0
  18. data/features/step_definitions/global_steps.rb +19 -0
  19. data/features/step_definitions/navigation_steps.rb +45 -0
  20. data/features/step_definitions/posts_steps.rb +113 -20
  21. data/features/support/env.rb +18 -0
  22. data/lib/crowdblog/version.rb +1 -1
  23. data/script/build +5 -1
  24. data/spec/dummy/app/models/user.rb +12 -0
  25. data/spec/dummy/config/application.rb +9 -0
  26. data/spec/dummy/config/initializers/crowdblog.rb +24 -0
  27. data/spec/dummy/config/initializers/devise.rb +3 -4
  28. data/spec/dummy/config/routes.rb +1 -0
  29. data/spec/fabricators/posts_fabricator.rb +21 -0
  30. data/spec/fabricators/users_fabricator.rb +19 -0
  31. data/spec/models/post_spec.rb +152 -56
  32. data/spec/models/user_spec.rb +57 -0
  33. metadata +116 -60
  34. data/README.rdoc +0 -3
  35. data/app/controllers/crowdblog/users/omniauth_callbacks_controller.rb +0 -21
  36. data/features/posts/manage_posts.feature +0 -46
  37. data/features/step_definitions/index_steps.rb +0 -16
  38. data/features/step_definitions/interaction_steps.rb +0 -26
  39. data/features/step_definitions/session_steps.rb +0 -15
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crowdblog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-02-24 00:00:00.000000000 Z
14
+ date: 2012-02-26 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
18
- requirement: &70146840670960 !ruby/object:Gem::Requirement
18
+ requirement: &70114209537520 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: '3.2'
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *70146840670960
26
+ version_requirements: *70114209537520
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: jquery-rails
29
- requirement: &70146840685240 !ruby/object:Gem::Requirement
29
+ requirement: &70114209536900 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: '0'
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *70146840685240
37
+ version_requirements: *70114209536900
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: backbone-rails
40
- requirement: &70146840684160 !ruby/object:Gem::Requirement
40
+ requirement: &70114209536200 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: '0'
46
46
  type: :runtime
47
47
  prerelease: false
48
- version_requirements: *70146840684160
48
+ version_requirements: *70114209536200
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: carrierwave
51
- requirement: &70146840683340 !ruby/object:Gem::Requirement
51
+ requirement: &70114209535560 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ! '>='
@@ -56,10 +56,10 @@ dependencies:
56
56
  version: '0'
57
57
  type: :runtime
58
58
  prerelease: false
59
- version_requirements: *70146840683340
59
+ version_requirements: *70114209535560
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: devise
62
- requirement: &70146840682460 !ruby/object:Gem::Requirement
62
+ requirement: &70114209550780 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ! '>='
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: '0'
68
68
  type: :runtime
69
69
  prerelease: false
70
- version_requirements: *70146840682460
70
+ version_requirements: *70114209550780
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: eco
73
- requirement: &70146840681700 !ruby/object:Gem::Requirement
73
+ requirement: &70114209549460 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ! '>='
@@ -78,10 +78,10 @@ dependencies:
78
78
  version: '0'
79
79
  type: :runtime
80
80
  prerelease: false
81
- version_requirements: *70146840681700
81
+ version_requirements: *70114209549460
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: gravtastic
84
- requirement: &70146840680860 !ruby/object:Gem::Requirement
84
+ requirement: &70114209548600 !ruby/object:Gem::Requirement
85
85
  none: false
86
86
  requirements:
87
87
  - - ! '>='
@@ -89,10 +89,10 @@ dependencies:
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
- version_requirements: *70146840680860
92
+ version_requirements: *70114209548600
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: less-rails-bootstrap
95
- requirement: &70146840680200 !ruby/object:Gem::Requirement
95
+ requirement: &70114209548020 !ruby/object:Gem::Requirement
96
96
  none: false
97
97
  requirements:
98
98
  - - ! '>='
@@ -100,10 +100,10 @@ dependencies:
100
100
  version: '0'
101
101
  type: :runtime
102
102
  prerelease: false
103
- version_requirements: *70146840680200
103
+ version_requirements: *70114209548020
104
104
  - !ruby/object:Gem::Dependency
105
- name: omniauth-google-apps
106
- requirement: &70146840679040 !ruby/object:Gem::Requirement
105
+ name: redcarpet
106
+ requirement: &70114209547520 !ruby/object:Gem::Requirement
107
107
  none: false
108
108
  requirements:
109
109
  - - ! '>='
@@ -111,10 +111,10 @@ dependencies:
111
111
  version: '0'
112
112
  type: :runtime
113
113
  prerelease: false
114
- version_requirements: *70146840679040
114
+ version_requirements: *70114209547520
115
115
  - !ruby/object:Gem::Dependency
116
- name: omniauth-google-oauth2
117
- requirement: &70146840678060 !ruby/object:Gem::Requirement
116
+ name: slim_assets
117
+ requirement: &70114209546900 !ruby/object:Gem::Requirement
118
118
  none: false
119
119
  requirements:
120
120
  - - ! '>='
@@ -122,10 +122,10 @@ dependencies:
122
122
  version: '0'
123
123
  type: :runtime
124
124
  prerelease: false
125
- version_requirements: *70146840678060
125
+ version_requirements: *70114209546900
126
126
  - !ruby/object:Gem::Dependency
127
- name: slim_assets
128
- requirement: &70146840693120 !ruby/object:Gem::Requirement
127
+ name: slim-rails
128
+ requirement: &70114209546360 !ruby/object:Gem::Requirement
129
129
  none: false
130
130
  requirements:
131
131
  - - ! '>='
@@ -133,10 +133,10 @@ dependencies:
133
133
  version: '0'
134
134
  type: :runtime
135
135
  prerelease: false
136
- version_requirements: *70146840693120
136
+ version_requirements: *70114209546360
137
137
  - !ruby/object:Gem::Dependency
138
- name: slim-rails
139
- requirement: &70146840692380 !ruby/object:Gem::Requirement
138
+ name: state_machine
139
+ requirement: &70114209545860 !ruby/object:Gem::Requirement
140
140
  none: false
141
141
  requirements:
142
142
  - - ! '>='
@@ -144,21 +144,21 @@ dependencies:
144
144
  version: '0'
145
145
  type: :runtime
146
146
  prerelease: false
147
- version_requirements: *70146840692380
147
+ version_requirements: *70114209545860
148
148
  - !ruby/object:Gem::Dependency
149
- name: state_machine
150
- requirement: &70146840691220 !ruby/object:Gem::Requirement
149
+ name: capybara-webkit
150
+ requirement: &70114209545420 !ruby/object:Gem::Requirement
151
151
  none: false
152
152
  requirements:
153
153
  - - ! '>='
154
154
  - !ruby/object:Gem::Version
155
155
  version: '0'
156
- type: :runtime
156
+ type: :development
157
157
  prerelease: false
158
- version_requirements: *70146840691220
158
+ version_requirements: *70114209545420
159
159
  - !ruby/object:Gem::Dependency
160
160
  name: cucumber-rails
161
- requirement: &70146840690500 !ruby/object:Gem::Requirement
161
+ requirement: &70114209544900 !ruby/object:Gem::Requirement
162
162
  none: false
163
163
  requirements:
164
164
  - - ! '>='
@@ -166,10 +166,32 @@ dependencies:
166
166
  version: '0'
167
167
  type: :development
168
168
  prerelease: false
169
- version_requirements: *70146840690500
169
+ version_requirements: *70114209544900
170
170
  - !ruby/object:Gem::Dependency
171
171
  name: database_cleaner
172
- requirement: &70146840689960 !ruby/object:Gem::Requirement
172
+ requirement: &70114209544460 !ruby/object:Gem::Requirement
173
+ none: false
174
+ requirements:
175
+ - - ! '>='
176
+ - !ruby/object:Gem::Version
177
+ version: '0'
178
+ type: :development
179
+ prerelease: false
180
+ version_requirements: *70114209544460
181
+ - !ruby/object:Gem::Dependency
182
+ name: fabrication
183
+ requirement: &70114209543460 !ruby/object:Gem::Requirement
184
+ none: false
185
+ requirements:
186
+ - - ! '>='
187
+ - !ruby/object:Gem::Version
188
+ version: '0'
189
+ type: :development
190
+ prerelease: false
191
+ version_requirements: *70114209543460
192
+ - !ruby/object:Gem::Dependency
193
+ name: faker
194
+ requirement: &70114209679500 !ruby/object:Gem::Requirement
173
195
  none: false
174
196
  requirements:
175
197
  - - ! '>='
@@ -177,10 +199,32 @@ dependencies:
177
199
  version: '0'
178
200
  type: :development
179
201
  prerelease: false
180
- version_requirements: *70146840689960
202
+ version_requirements: *70114209679500
181
203
  - !ruby/object:Gem::Dependency
182
204
  name: fuubar
183
- requirement: &70146840689520 !ruby/object:Gem::Requirement
205
+ requirement: &70114209677600 !ruby/object:Gem::Requirement
206
+ none: false
207
+ requirements:
208
+ - - ! '>='
209
+ - !ruby/object:Gem::Version
210
+ version: '0'
211
+ type: :development
212
+ prerelease: false
213
+ version_requirements: *70114209677600
214
+ - !ruby/object:Gem::Dependency
215
+ name: fuubar-cucumber
216
+ requirement: &70114209673060 !ruby/object:Gem::Requirement
217
+ none: false
218
+ requirements:
219
+ - - ! '>='
220
+ - !ruby/object:Gem::Version
221
+ version: '0'
222
+ type: :development
223
+ prerelease: false
224
+ version_requirements: *70114209673060
225
+ - !ruby/object:Gem::Dependency
226
+ name: headless
227
+ requirement: &70114209754380 !ruby/object:Gem::Requirement
184
228
  none: false
185
229
  requirements:
186
230
  - - ! '>='
@@ -188,10 +232,10 @@ dependencies:
188
232
  version: '0'
189
233
  type: :development
190
234
  prerelease: false
191
- version_requirements: *70146840689520
235
+ version_requirements: *70114209754380
192
236
  - !ruby/object:Gem::Dependency
193
237
  name: rspec-rails
194
- requirement: &70146840689000 !ruby/object:Gem::Requirement
238
+ requirement: &70114209752840 !ruby/object:Gem::Requirement
195
239
  none: false
196
240
  requirements:
197
241
  - - ! '>='
@@ -199,10 +243,10 @@ dependencies:
199
243
  version: '0'
200
244
  type: :development
201
245
  prerelease: false
202
- version_requirements: *70146840689000
246
+ version_requirements: *70114209752840
203
247
  - !ruby/object:Gem::Dependency
204
248
  name: simplecov
205
- requirement: &70146840688240 !ruby/object:Gem::Requirement
249
+ requirement: &70114209750780 !ruby/object:Gem::Requirement
206
250
  none: false
207
251
  requirements:
208
252
  - - ! '>='
@@ -210,10 +254,10 @@ dependencies:
210
254
  version: '0'
211
255
  type: :development
212
256
  prerelease: false
213
- version_requirements: *70146840688240
257
+ version_requirements: *70114209750780
214
258
  - !ruby/object:Gem::Dependency
215
259
  name: simplecov-rcov-text
216
- requirement: &70146840687780 !ruby/object:Gem::Requirement
260
+ requirement: &70114209750060 !ruby/object:Gem::Requirement
217
261
  none: false
218
262
  requirements:
219
263
  - - ! '>='
@@ -221,10 +265,10 @@ dependencies:
221
265
  version: '0'
222
266
  type: :development
223
267
  prerelease: false
224
- version_requirements: *70146840687780
268
+ version_requirements: *70114209750060
225
269
  - !ruby/object:Gem::Dependency
226
270
  name: sqlite3
227
- requirement: &70146840687200 !ruby/object:Gem::Requirement
271
+ requirement: &70114209748800 !ruby/object:Gem::Requirement
228
272
  none: false
229
273
  requirements:
230
274
  - - ! '>='
@@ -232,7 +276,7 @@ dependencies:
232
276
  version: '0'
233
277
  type: :development
234
278
  prerelease: false
235
- version_requirements: *70146840687200
279
+ version_requirements: *70114209748800
236
280
  description: This mountable engine has the basic functionality to manage Posts
237
281
  email:
238
282
  - opensource@crowdint.com
@@ -246,10 +290,11 @@ files:
246
290
  - .rspec
247
291
  - .rvmrc
248
292
  - .simplecov
293
+ - .travis.yml
249
294
  - Gemfile
250
295
  - Gemfile.lock
251
296
  - MIT-LICENSE
252
- - README.rdoc
297
+ - README.md
253
298
  - Rakefile
254
299
  - app/assets/images/crowdblog/.gitkeep
255
300
  - app/assets/images/crowdblog/logo.png
@@ -272,7 +317,6 @@ files:
272
317
  - app/controllers/crowdblog/authors_controller.rb
273
318
  - app/controllers/crowdblog/posts_controller.rb
274
319
  - app/controllers/crowdblog/sessions_controller.rb
275
- - app/controllers/crowdblog/users/omniauth_callbacks_controller.rb
276
320
  - app/helpers/crowdblog/application_helper.rb
277
321
  - app/models/crowdblog/asset.rb
278
322
  - app/models/crowdblog/post.rb
@@ -293,11 +337,12 @@ files:
293
337
  - db/migrate/20120219071614_create_assets.rb
294
338
  - db/migrate/20120219234253_add_alias_to_users.rb
295
339
  - db/migrate/20120220033923_create_vestal_versions.rb
296
- - features/posts/manage_posts.feature
297
- - features/step_definitions/index_steps.rb
298
- - features/step_definitions/interaction_steps.rb
340
+ - features/posts/listing.feature
341
+ - features/posts/manage.feature
342
+ - features/posts/publish.feature
343
+ - features/step_definitions/global_steps.rb
344
+ - features/step_definitions/navigation_steps.rb
299
345
  - features/step_definitions/posts_steps.rb
300
- - features/step_definitions/session_steps.rb
301
346
  - features/support/env.rb
302
347
  - lib/crowdblog.rb
303
348
  - lib/crowdblog/engine.rb
@@ -315,6 +360,7 @@ files:
315
360
  - spec/dummy/app/helpers/application_helper.rb
316
361
  - spec/dummy/app/mailers/.gitkeep
317
362
  - spec/dummy/app/models/.gitkeep
363
+ - spec/dummy/app/models/user.rb
318
364
  - spec/dummy/app/views/layouts/application.html.erb
319
365
  - spec/dummy/config.ru
320
366
  - spec/dummy/config/application.rb
@@ -326,6 +372,7 @@ files:
326
372
  - spec/dummy/config/environments/test.rb
327
373
  - spec/dummy/config/initializers/backtrace_silencers.rb
328
374
  - spec/dummy/config/initializers/carrierwave.rb
375
+ - spec/dummy/config/initializers/crowdblog.rb
329
376
  - spec/dummy/config/initializers/devise.rb
330
377
  - spec/dummy/config/initializers/inflections.rb
331
378
  - spec/dummy/config/initializers/mime_types.rb
@@ -343,8 +390,11 @@ files:
343
390
  - spec/dummy/public/500.html
344
391
  - spec/dummy/public/favicon.ico
345
392
  - spec/dummy/script/rails
393
+ - spec/fabricators/posts_fabricator.rb
394
+ - spec/fabricators/users_fabricator.rb
346
395
  - spec/helpers/application_helper_spec.rb
347
396
  - spec/models/post_spec.rb
397
+ - spec/models/user_spec.rb
348
398
  - spec/spec_helper.rb
349
399
  - vendor/assets/javascripts/jquery.uploadify.js
350
400
  - vendor/assets/javascripts/swfobject.js
@@ -363,7 +413,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
363
413
  version: '0'
364
414
  segments:
365
415
  - 0
366
- hash: -432439861063230765
416
+ hash: -4581711537524363820
367
417
  required_rubygems_version: !ruby/object:Gem::Requirement
368
418
  none: false
369
419
  requirements:
@@ -372,7 +422,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
372
422
  version: '0'
373
423
  segments:
374
424
  - 0
375
- hash: -432439861063230765
425
+ hash: -4581711537524363820
376
426
  requirements: []
377
427
  rubyforge_project:
378
428
  rubygems_version: 1.8.10
@@ -380,11 +430,12 @@ signing_key:
380
430
  specification_version: 3
381
431
  summary: CrowdBlog base functionality and backend
382
432
  test_files:
383
- - features/posts/manage_posts.feature
384
- - features/step_definitions/index_steps.rb
385
- - features/step_definitions/interaction_steps.rb
433
+ - features/posts/listing.feature
434
+ - features/posts/manage.feature
435
+ - features/posts/publish.feature
436
+ - features/step_definitions/global_steps.rb
437
+ - features/step_definitions/navigation_steps.rb
386
438
  - features/step_definitions/posts_steps.rb
387
- - features/step_definitions/session_steps.rb
388
439
  - features/support/env.rb
389
440
  - spec/dummy/.rvmrc
390
441
  - spec/dummy/README.rdoc
@@ -395,6 +446,7 @@ test_files:
395
446
  - spec/dummy/app/helpers/application_helper.rb
396
447
  - spec/dummy/app/mailers/.gitkeep
397
448
  - spec/dummy/app/models/.gitkeep
449
+ - spec/dummy/app/models/user.rb
398
450
  - spec/dummy/app/views/layouts/application.html.erb
399
451
  - spec/dummy/config.ru
400
452
  - spec/dummy/config/application.rb
@@ -406,6 +458,7 @@ test_files:
406
458
  - spec/dummy/config/environments/test.rb
407
459
  - spec/dummy/config/initializers/backtrace_silencers.rb
408
460
  - spec/dummy/config/initializers/carrierwave.rb
461
+ - spec/dummy/config/initializers/crowdblog.rb
409
462
  - spec/dummy/config/initializers/devise.rb
410
463
  - spec/dummy/config/initializers/inflections.rb
411
464
  - spec/dummy/config/initializers/mime_types.rb
@@ -423,6 +476,9 @@ test_files:
423
476
  - spec/dummy/public/500.html
424
477
  - spec/dummy/public/favicon.ico
425
478
  - spec/dummy/script/rails
479
+ - spec/fabricators/posts_fabricator.rb
480
+ - spec/fabricators/users_fabricator.rb
426
481
  - spec/helpers/application_helper_spec.rb
427
482
  - spec/models/post_spec.rb
483
+ - spec/models/user_spec.rb
428
484
  - spec/spec_helper.rb
data/README.rdoc DELETED
@@ -1,3 +0,0 @@
1
- = CrowdBlog
2
-
3
- This project rocks!
@@ -1,21 +0,0 @@
1
- module Crowdblog
2
- class OmniauthCallbacksController < Devise::OmniauthCallbacksController
3
-
4
- def google_apps
5
- auth_hash = request.env['omniauth.auth']
6
- email = auth_hash.info['email']
7
- Rails.logger.info auth_hash
8
-
9
- user = User.find_by_email(email)
10
- user ||= User.create!(email: email, name: auth_hash.info['name'])
11
-
12
- if user.persisted?
13
- sign_in_and_redirect user
14
- end
15
- end
16
-
17
- #def google_apps
18
- #end
19
-
20
- end
21
- end
@@ -1,46 +0,0 @@
1
- @javascript
2
- Feature: Manage Posts
3
-
4
- Scenario: Posts CRUD
5
- Given I am signed in as "test@test.com"
6
- And current user is publisher
7
- And I go to the posts page
8
- And I click on "New Post"
9
- And I fill "A Great Post Title" as the post title
10
- And I fill "Body" as the post body
11
- And I press "Save"
12
- Then I should see "A Great Post Title"
13
- And I should see "test@test.com"
14
- And the post "A Great Post Title" should be authored by current user
15
- And the post "A Great Post Title" should have "a-great-post-title" as its permalink
16
- When I click "Edit" for "A Great Post Title"
17
- And I fill "Another Great Post Title" as the post title
18
- And I press "Save"
19
- Then I should see "Another Great Post Title"
20
- When I click "Delete" for "Another Great Post Title"
21
- Then I should not see "Another Great Post Title"
22
-
23
- Scenario: Publish unpublish post
24
- Given I am signed in as "test@test.com"
25
- And current user is publisher
26
- And An author with name "Johan Crupps" and email "johan@crupps.com"
27
- And the following posts by "Johan Crupps":
28
- | title | body | published |
29
- | The great gatsby | Lorem Ipsum Cohiben Allen | false |
30
- And I go to the posts page
31
- When I click on "Publish"
32
- Then the post titled "The great gatsby" is marked as published
33
- And current user is set as its publisher
34
- When I click on "Publish"
35
- Then the post titled "The great gatsby" is marked as drafted
36
-
37
- Scenario: Do not show posts for non-publishers
38
- Given I am signed in as "test@test.com"
39
- And An author with name "Johan Crupps" and email "johan@crupps.com"
40
- And the following posts by "Johan Crupps":
41
- | title | body | published |
42
- | The great gatsby | Lorem Ipsum Cohiben Allen | false |
43
- And I go to the posts page
44
- Then I should not see "The great gatsby"
45
-
46
-
@@ -1,16 +0,0 @@
1
- Given /^the following posts by "([^"]*)":$/ do |name, table|
2
- author = Crowdblog::User.find_by_name name
3
- table.hashes.each_with_index do |hash, index|
4
- time_index = (index * 5)
5
- p = Crowdblog::Post.create!(title: hash[:title], body: hash[:body])
6
- p.author = author
7
- p.regenerate_permalink
8
- p.save!
9
- p.publish if hash[:published] == 'true'
10
- p.update_attribute(:published_at, time_index.days.ago)
11
- end
12
- end
13
-
14
- When /^I go to the index page$/ do
15
- visit root_path
16
- end
@@ -1,26 +0,0 @@
1
- Given /^I click on "([^"]*)"$/ do |link_name|
2
- click_link link_name
3
- end
4
-
5
- Given /^I press "([^"]*)"$/ do |button_name|
6
- click_button button_name
7
- end
8
-
9
- Then /^I should see "([^"]*)"$/ do |expectation|
10
- page.should have_content expectation
11
- end
12
-
13
- When /^I click "([^"]*)" for "([^"]*)"$/ do |link_text, row_text|
14
- page.execute_script 'window.confirm = function() { return true }'
15
- find("tr:contains('#{row_text}')").find("a:contains('#{link_text}')").click
16
- end
17
-
18
- Then /^I should not see "([^"]*)"$/ do |expectation|
19
- page.should_not have_content expectation
20
- end
21
-
22
- Then /^I should see:$/ do |table|
23
- table.raw.flatten.each do |expected|
24
- page.should have_content expected
25
- end
26
- end
@@ -1,15 +0,0 @@
1
- include Devise::TestHelpers
2
-
3
- Given /^I am signed in as "([^"]*)"$/ do |email|
4
- @current_user = Crowdblog::User.create!(email: email)
5
- @current_user.reset_authentication_token!
6
- visit crowdblog_path + "?auth_token=#{@current_user.authentication_token}"
7
- end
8
-
9
- Given /^An author with name "([^"]*)" and email "([^"]*)"$/ do |name, email|
10
- Crowdblog::User.create!(name: name, email: email)
11
- end
12
-
13
- Given /^current user is publisher$/ do
14
- @current_user.update_attribute(:is_publisher, true)
15
- end