thumblemonks-chicago 0.2 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +11 -1
- data/chicago.gemspec +2 -2
- data/lib/chicago/shoulda/sinatra.rb +12 -0
- metadata +2 -2
data/README.markdown
CHANGED
@@ -15,10 +15,20 @@ In your Sinatra app, do this:
|
|
15
15
|
|
16
16
|
And you'll get some helpful Sinatra extensions and helpers.
|
17
17
|
|
18
|
+
If you're Sinatra app is considered modular - as in, you are not using the `Sinatra::Default` app - you will want to add the following in your app:
|
19
|
+
|
20
|
+
YourApp < Sinatra::Base
|
21
|
+
register Sinatra::ThumbleMonks::Base # for some DSL helpers
|
22
|
+
helpers Sinatra::ThumbleMonks::Helpers # for standard helpers
|
23
|
+
helpers Sinatra::ThumbleMonks::Responders # for JSON assistance
|
24
|
+
end
|
25
|
+
|
26
|
+
You don't necessarily need all of them. You just need to "include" the statements that mix-in the functionality you want.
|
27
|
+
|
18
28
|
### Sinatra testing
|
19
29
|
|
20
30
|
If you're using Shoulda in your tests of your Sinatra app, do this:
|
21
31
|
|
22
32
|
require 'chicago/shoulda'
|
23
33
|
|
24
|
-
... and you'll get a bunch of cool Shoulda macros for testing specific Sinatra stuff.
|
34
|
+
... and you'll get a bunch of cool Shoulda macros for testing specific Sinatra stuff.
|
data/chicago.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "chicago"
|
3
|
-
s.version = "0.2"
|
4
|
-
s.date = "2009-
|
3
|
+
s.version = "0.2.1"
|
4
|
+
s.date = "2009-04-07"
|
5
5
|
s.summary = "Sinatra runtime and testing extensions used commonly by Thumblemonks"
|
6
6
|
s.email = %w[gus@gusg.us gabriel.gironda@gmail.com]
|
7
7
|
s.homepage = "http://github.com/thumblemonks/chicago/tree/master"
|
@@ -32,6 +32,18 @@ module ThumbleMonks
|
|
32
32
|
assert_response_body json
|
33
33
|
end
|
34
34
|
end
|
35
|
+
|
36
|
+
# Checks to see if there is a redirect in play and the path the redirect goes to
|
37
|
+
#
|
38
|
+
# Example:
|
39
|
+
# should_be_redirected_to { "/users/@user.id" }
|
40
|
+
# should_be_redirected_to "/home"
|
41
|
+
def self.should_be_redirected_to(expected_path=nil, &block)
|
42
|
+
should "be redirected to #{expected_path | 'a url'}" do
|
43
|
+
expected_path = self.instance_eval(&block) if block_given?
|
44
|
+
assert_redirected_to expected_path
|
45
|
+
end
|
46
|
+
end
|
35
47
|
end # Macros
|
36
48
|
|
37
49
|
module Helpers
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thumblemonks-chicago
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Knowlden
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-
|
13
|
+
date: 2009-04-07 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|