peck-on-rails 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. data/lib/peck_on_rails.rb +19 -1
  2. metadata +2 -2
data/lib/peck_on_rails.rb CHANGED
@@ -17,7 +17,7 @@ class Peck
17
17
  end
18
18
 
19
19
  def self.backtrace_cleaner
20
- @backtrace_cleaner ||= ::Rails::BacktraceCleaner.new
20
+ ::Rails.backtrace_cleaner
21
21
  end
22
22
  end
23
23
 
@@ -299,6 +299,16 @@ class Peck
299
299
  end
300
300
  end
301
301
 
302
+ class Response < ResponseRequirement
303
+ def description(verb, action, params={})
304
+ description = ["should"]
305
+ description << "not" if (negated == false)
306
+ description << "be allowed to #{verb.upcase}s `#{action}'"
307
+ description << "#{params.inspect}" unless params.blank?
308
+ description.join(' ')
309
+ end
310
+ end
311
+
302
312
  class Specification
303
313
  def require_login
304
314
  requirement = RequireLogin.new(context)
@@ -323,6 +333,14 @@ class Peck
323
333
  requirement.expected = true
324
334
  requirement
325
335
  end
336
+
337
+ def find
338
+ requirement = Response.new(context)
339
+ requirement.negated = !@negated
340
+ requirement.method = :status
341
+ requirement.expected = :ok
342
+ requirement
343
+ end
326
344
  end
327
345
  end
328
346
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peck-on-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-28 00:00:00.000000000 Z
12
+ date: 2013-05-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: peck