remarkable_rails 3.1.8 → 3.1.9
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/CHANGELOG +91 -88
- data/LICENSE +20 -20
- data/README +80 -80
- data/lib/remarkable_rails/action_controller/base.rb +29 -29
- data/lib/remarkable_rails/action_controller/macro_stubs.rb +459 -457
- data/lib/remarkable_rails/action_controller/matchers/assign_to_matcher.rb +92 -92
- data/lib/remarkable_rails/action_controller/matchers/filter_params_matcher.rb +41 -41
- data/lib/remarkable_rails/action_controller/matchers/redirect_to_matcher.rb +119 -119
- data/lib/remarkable_rails/action_controller/matchers/render_template_matcher.rb +146 -146
- data/lib/remarkable_rails/action_controller/matchers/respond_with_matcher.rb +126 -126
- data/lib/remarkable_rails/action_controller/matchers/route_matcher.rb +135 -109
- data/lib/remarkable_rails/action_controller/matchers/set_cookies_matcher.rb +49 -49
- data/lib/remarkable_rails/action_controller/matchers/set_session_matcher.rb +106 -106
- data/lib/remarkable_rails/action_controller/matchers/set_the_flash_matcher.rb +54 -54
- data/lib/remarkable_rails/action_controller.rb +22 -22
- data/lib/remarkable_rails/action_view/base.rb +7 -7
- data/lib/remarkable_rails/action_view.rb +18 -18
- data/lib/remarkable_rails/active_orm.rb +19 -19
- data/lib/remarkable_rails.rb +30 -30
- data/locale/en.yml +110 -110
- data/spec/action_controller/assign_to_matcher_spec.rb +142 -142
- data/spec/action_controller/filter_params_matcher_spec.rb +64 -64
- data/spec/action_controller/macro_stubs_spec.rb +234 -208
- data/spec/action_controller/redirect_to_matcher_spec.rb +102 -102
- data/spec/action_controller/render_template_matcher_spec.rb +251 -251
- data/spec/action_controller/respond_with_matcher_spec.rb +223 -223
- data/spec/action_controller/route_matcher_spec.rb +96 -79
- data/spec/action_controller/set_cookies_matcher_spec.rb +149 -149
- data/spec/action_controller/set_session_matcher_spec.rb +141 -141
- data/spec/action_controller/set_the_flash_matcher_spec.rb +93 -93
- data/spec/application/application.rb +15 -15
- data/spec/application/tasks_controller.rb +34 -34
- data/spec/functional_builder.rb +88 -88
- data/spec/rcov.opts +2 -2
- data/spec/remarkable_rails_spec.rb +5 -5
- data/spec/spec.opts +4 -4
- data/spec/spec_helper.rb +42 -42
- metadata +7 -7
@@ -1,171 +1,171 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
-
|
3
|
-
describe 'set_cookies' do
|
4
|
-
include FunctionalBuilder
|
5
|
-
|
6
|
-
describe 'messages' do
|
7
|
-
before(:each) do
|
8
|
-
@matcher = set_cookies(:user).to(1)
|
9
|
-
end
|
10
|
-
|
11
|
-
it 'should contain a description message' do
|
12
|
-
@matcher = set_cookies(:user)
|
13
|
-
@matcher.description.should == 'set cookies user'
|
14
|
-
|
15
|
-
@matcher.to(1)
|
16
|
-
@matcher.description.should == 'set cookies user to 1'
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'should set is_not_empty? message' do
|
20
|
-
build_response
|
21
|
-
@matcher = set_cookies
|
22
|
-
@matcher.matches?(@controller)
|
23
|
-
@matcher.failure_message.should == 'Expected any cookie to be set, got {}'
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'should set assigned_value? message' do
|
27
|
-
build_response
|
28
|
-
@matcher = set_cookies(:user)
|
29
|
-
@matcher.matches?(@controller)
|
30
|
-
@matcher.failure_message.should == 'Expected cookie user to be set, got {}'
|
31
|
-
end
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
+
|
3
|
+
describe 'set_cookies' do
|
4
|
+
include FunctionalBuilder
|
5
|
+
|
6
|
+
describe 'messages' do
|
7
|
+
before(:each) do
|
8
|
+
@matcher = set_cookies(:user).to(1)
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should contain a description message' do
|
12
|
+
@matcher = set_cookies(:user)
|
13
|
+
@matcher.description.should == 'set cookies user'
|
14
|
+
|
15
|
+
@matcher.to(1)
|
16
|
+
@matcher.description.should == 'set cookies user to 1'
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'should set is_not_empty? message' do
|
20
|
+
build_response
|
21
|
+
@matcher = set_cookies
|
22
|
+
@matcher.matches?(@controller)
|
23
|
+
@matcher.failure_message.should == 'Expected any cookie to be set, got {}'
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should set assigned_value? message' do
|
27
|
+
build_response
|
28
|
+
@matcher = set_cookies(:user)
|
29
|
+
@matcher.matches?(@controller)
|
30
|
+
@matcher.failure_message.should == 'Expected cookie user to be set, got {}'
|
31
|
+
end
|
32
32
|
|
33
33
|
if RAILS_VERSION =~ /^2.(1|2)/
|
34
|
-
it 'should set contains_value? message' do
|
35
|
-
build_response { cookies[:user] = 10 }
|
36
|
-
@matcher = set_cookies.to(1)
|
37
|
-
@matcher.matches?(@controller)
|
38
|
-
@matcher.failure_message.should == 'Expected any cookie to be set to [1], got {:user=>[10]}'
|
34
|
+
it 'should set contains_value? message' do
|
35
|
+
build_response { cookies[:user] = 10 }
|
36
|
+
@matcher = set_cookies.to(1)
|
37
|
+
@matcher.matches?(@controller)
|
38
|
+
@matcher.failure_message.should == 'Expected any cookie to be set to [1], got {:user=>[10]}'
|
39
39
|
end
|
40
|
-
|
41
|
-
it 'should set is_equal_value? message' do
|
42
|
-
build_response { cookies[:user] = 2 }
|
43
|
-
@matcher.matches?(@controller)
|
44
|
-
@matcher.failure_message.should == 'Expected cookie user to be set to [1], got {:user=>[2]}'
|
40
|
+
|
41
|
+
it 'should set is_equal_value? message' do
|
42
|
+
build_response { cookies[:user] = 2 }
|
43
|
+
@matcher.matches?(@controller)
|
44
|
+
@matcher.failure_message.should == 'Expected cookie user to be set to [1], got {:user=>[2]}'
|
45
45
|
end
|
46
46
|
else
|
47
|
-
it 'should set contains_value? message' do
|
48
|
-
build_response { cookies[:user] = 10 }
|
49
|
-
@matcher = set_cookies.to(1)
|
50
|
-
@matcher.matches?(@controller)
|
51
|
-
@matcher.failure_message.should == 'Expected any cookie to be set to "1", got {:user=>"10"}'
|
47
|
+
it 'should set contains_value? message' do
|
48
|
+
build_response { cookies[:user] = 10 }
|
49
|
+
@matcher = set_cookies.to(1)
|
50
|
+
@matcher.matches?(@controller)
|
51
|
+
@matcher.failure_message.should == 'Expected any cookie to be set to "1", got {:user=>"10"}'
|
52
52
|
end
|
53
|
-
|
54
|
-
it 'should set is_equal_value? message' do
|
55
|
-
build_response { cookies[:user] = 2 }
|
56
|
-
@matcher.matches?(@controller)
|
57
|
-
@matcher.failure_message.should == 'Expected cookie user to be set to "1", got {:user=>"2"}'
|
53
|
+
|
54
|
+
it 'should set is_equal_value? message' do
|
55
|
+
build_response { cookies[:user] = 2 }
|
56
|
+
@matcher.matches?(@controller)
|
57
|
+
@matcher.failure_message.should == 'Expected cookie user to be set to "1", got {:user=>"2"}'
|
58
58
|
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
describe 'matcher' do
|
63
|
-
before(:each) do
|
64
|
-
build_response {
|
65
|
-
cookies[:user] = 'jose'
|
66
|
-
cookies[:true] = true
|
67
|
-
cookies[:false] = false
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
describe 'matcher' do
|
63
|
+
before(:each) do
|
64
|
+
build_response {
|
65
|
+
cookies[:user] = 'jose'
|
66
|
+
cookies[:true] = true
|
67
|
+
cookies[:false] = false
|
68
68
|
cookies[:nil] = nil
|
69
69
|
cookies[:array] = [1,2]
|
70
|
-
cookies[:date] = Date.today
|
71
|
-
}
|
72
|
-
end
|
73
|
-
|
74
|
-
it { should set_cookies }
|
75
|
-
it { should set_cookies.to('jose') }
|
76
|
-
it { should set_cookies(:user) }
|
77
|
-
it { should set_cookies(:user).to('jose') }
|
78
|
-
|
79
|
-
it { should_not set_cookies.to('joseph') }
|
80
|
-
it { should_not set_cookies(:post) }
|
81
|
-
it { should_not set_cookies(:user).to('joseph') }
|
82
|
-
|
83
|
-
it { should set_cookies(:user){ 'jose' } }
|
84
|
-
it { should set_cookies(:user, :to => proc{ 'jose' }) }
|
85
|
-
|
86
|
-
it { should_not set_cookies(:user).to(nil) }
|
87
|
-
it { should_not set_cookies(:user){ 'joseph' } }
|
88
|
-
it { should_not set_cookies(:user, :to => proc{ 'joseph' }) }
|
89
|
-
|
90
|
-
it { should set_cookies(:true) }
|
91
|
-
it { should set_cookies(:true).to(true) }
|
92
|
-
it { should_not set_cookies(:true).to(false) }
|
93
|
-
|
94
|
-
it { should set_cookies(:false) }
|
95
|
-
it { should set_cookies(:false).to(false) }
|
96
|
-
it { should_not set_cookies(:false).to(true) }
|
97
|
-
|
98
|
-
it { should set_cookies(:nil) }
|
99
|
-
it { should set_cookies(:nil).to(nil) }
|
70
|
+
cookies[:date] = Date.today
|
71
|
+
}
|
72
|
+
end
|
73
|
+
|
74
|
+
it { should set_cookies }
|
75
|
+
it { should set_cookies.to('jose') }
|
76
|
+
it { should set_cookies(:user) }
|
77
|
+
it { should set_cookies(:user).to('jose') }
|
78
|
+
|
79
|
+
it { should_not set_cookies.to('joseph') }
|
80
|
+
it { should_not set_cookies(:post) }
|
81
|
+
it { should_not set_cookies(:user).to('joseph') }
|
82
|
+
|
83
|
+
it { should set_cookies(:user){ 'jose' } }
|
84
|
+
it { should set_cookies(:user, :to => proc{ 'jose' }) }
|
85
|
+
|
86
|
+
it { should_not set_cookies(:user).to(nil) }
|
87
|
+
it { should_not set_cookies(:user){ 'joseph' } }
|
88
|
+
it { should_not set_cookies(:user, :to => proc{ 'joseph' }) }
|
89
|
+
|
90
|
+
it { should set_cookies(:true) }
|
91
|
+
it { should set_cookies(:true).to(true) }
|
92
|
+
it { should_not set_cookies(:true).to(false) }
|
93
|
+
|
94
|
+
it { should set_cookies(:false) }
|
95
|
+
it { should set_cookies(:false).to(false) }
|
96
|
+
it { should_not set_cookies(:false).to(true) }
|
97
|
+
|
98
|
+
it { should set_cookies(:nil) }
|
99
|
+
it { should set_cookies(:nil).to(nil) }
|
100
100
|
it { should_not set_cookies(:nil).to(true) }
|
101
101
|
|
102
|
-
it { should set_cookies(:array) }
|
103
|
-
it { should set_cookies(:array).to([1,2]) }
|
102
|
+
it { should set_cookies(:array) }
|
103
|
+
it { should set_cookies(:array).to([1,2]) }
|
104
104
|
it { should_not set_cookies(:array).to([2,1]) }
|
105
105
|
|
106
|
-
it { should set_cookies(:date) }
|
107
|
-
it { should set_cookies(:date).to(Date.today) }
|
108
|
-
it { should_not set_cookies(:date).to(Date.today + 1) }
|
109
|
-
end
|
110
|
-
|
111
|
-
describe 'macro' do
|
112
|
-
before(:each) do
|
113
|
-
build_response {
|
114
|
-
cookies[:user] = 'jose'
|
115
|
-
cookies[:true] = true
|
116
|
-
cookies[:false] = false
|
106
|
+
it { should set_cookies(:date) }
|
107
|
+
it { should set_cookies(:date).to(Date.today) }
|
108
|
+
it { should_not set_cookies(:date).to(Date.today + 1) }
|
109
|
+
end
|
110
|
+
|
111
|
+
describe 'macro' do
|
112
|
+
before(:each) do
|
113
|
+
build_response {
|
114
|
+
cookies[:user] = 'jose'
|
115
|
+
cookies[:true] = true
|
116
|
+
cookies[:false] = false
|
117
117
|
cookies[:nil] = nil
|
118
118
|
cookies[:array] = [1,2]
|
119
|
-
cookies[:date] = Date.today
|
120
|
-
}
|
121
|
-
end
|
122
|
-
|
123
|
-
should_set_cookies
|
124
|
-
should_set_cookies :to => 'jose'
|
125
|
-
should_set_cookies :user
|
126
|
-
should_set_cookies :user, :to => 'jose'
|
127
|
-
|
128
|
-
should_not_set_cookies :to => 'joseph'
|
129
|
-
should_not_set_cookies :post
|
130
|
-
should_not_set_cookies :user, :to => 'joseph'
|
131
|
-
|
132
|
-
should_set_cookies(:user){ 'jose' }
|
119
|
+
cookies[:date] = Date.today
|
120
|
+
}
|
121
|
+
end
|
122
|
+
|
123
|
+
should_set_cookies
|
124
|
+
should_set_cookies :to => 'jose'
|
125
|
+
should_set_cookies :user
|
126
|
+
should_set_cookies :user, :to => 'jose'
|
127
|
+
|
128
|
+
should_not_set_cookies :to => 'joseph'
|
129
|
+
should_not_set_cookies :post
|
130
|
+
should_not_set_cookies :user, :to => 'joseph'
|
131
|
+
|
132
|
+
should_set_cookies(:user){ 'jose' }
|
133
133
|
should_set_cookies :user, :to => proc{ 'jose' }
|
134
134
|
should_set_cookies :user do |m|
|
135
135
|
m.to { 'jose' }
|
136
|
-
end
|
137
|
-
|
138
|
-
should_not_set_cookies :user, :to => nil
|
139
|
-
should_not_set_cookies(:user){ 'joseph' }
|
140
|
-
should_not_set_cookies :user, :to => proc{ 'joseph' }
|
141
|
-
|
142
|
-
should_set_cookies :true
|
143
|
-
should_set_cookies :true, :to => true
|
144
|
-
should_not_set_cookies :true, :to => false
|
145
|
-
|
146
|
-
should_set_cookies :false
|
147
|
-
should_set_cookies :false, :to => false
|
148
|
-
should_not_set_cookies :false, :to => true
|
149
|
-
|
150
|
-
should_set_cookies :nil
|
151
|
-
should_set_cookies :nil, :to => nil
|
136
|
+
end
|
137
|
+
|
138
|
+
should_not_set_cookies :user, :to => nil
|
139
|
+
should_not_set_cookies(:user){ 'joseph' }
|
140
|
+
should_not_set_cookies :user, :to => proc{ 'joseph' }
|
141
|
+
|
142
|
+
should_set_cookies :true
|
143
|
+
should_set_cookies :true, :to => true
|
144
|
+
should_not_set_cookies :true, :to => false
|
145
|
+
|
146
|
+
should_set_cookies :false
|
147
|
+
should_set_cookies :false, :to => false
|
148
|
+
should_not_set_cookies :false, :to => true
|
149
|
+
|
150
|
+
should_set_cookies :nil
|
151
|
+
should_set_cookies :nil, :to => nil
|
152
152
|
should_not_set_cookies :nil, :to => true
|
153
153
|
|
154
|
-
should_set_cookies :array
|
155
|
-
should_set_cookies :array, :to => [1,2]
|
154
|
+
should_set_cookies :array
|
155
|
+
should_set_cookies :array, :to => [1,2]
|
156
156
|
should_not_set_cookies :array, :to => [2,1]
|
157
157
|
|
158
|
-
should_set_cookies :date
|
159
|
-
should_set_cookies :date, :to => Date.today
|
160
|
-
should_not_set_cookies :date, :to => (Date.today + 1)
|
161
|
-
end
|
162
|
-
|
163
|
-
describe 'with no parameter' do
|
164
|
-
before(:each) { build_response }
|
165
|
-
|
166
|
-
should_not_set_cookies
|
167
|
-
it { should_not set_cookies }
|
168
|
-
end
|
169
|
-
|
170
|
-
generate_macro_stubs_specs_for(:set_cookies)
|
171
|
-
end
|
158
|
+
should_set_cookies :date
|
159
|
+
should_set_cookies :date, :to => Date.today
|
160
|
+
should_not_set_cookies :date, :to => (Date.today + 1)
|
161
|
+
end
|
162
|
+
|
163
|
+
describe 'with no parameter' do
|
164
|
+
before(:each) { build_response }
|
165
|
+
|
166
|
+
should_not_set_cookies
|
167
|
+
it { should_not set_cookies }
|
168
|
+
end
|
169
|
+
|
170
|
+
generate_macro_stubs_specs_for(:set_cookies)
|
171
|
+
end
|
@@ -1,157 +1,157 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
-
|
3
|
-
describe 'set_session' do
|
4
|
-
include FunctionalBuilder
|
5
|
-
|
6
|
-
describe 'messages' do
|
7
|
-
before(:each) do
|
8
|
-
@matcher = set_session(:user).to(1)
|
9
|
-
end
|
10
|
-
|
11
|
-
it 'should contain a description message' do
|
12
|
-
@matcher = set_session(:user)
|
13
|
-
@matcher.description.should == 'set session variable user'
|
14
|
-
|
15
|
-
@matcher.to(1)
|
16
|
-
@matcher.description.should == 'set session variable user to 1'
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'should set is_not_empty? message' do
|
20
|
-
build_response
|
21
|
-
@matcher = set_session
|
22
|
-
@matcher.matches?(@controller)
|
23
|
-
@matcher.failure_message.should == 'Expected any session variable to be set, got {}'
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'should set contains_value? message' do
|
27
|
-
build_response { session[:user] = 10 }
|
28
|
-
@matcher = set_session.to(1)
|
29
|
-
@matcher.matches?(@controller)
|
30
|
-
@matcher.failure_message.should == 'Expected any session variable to be set to 1, got {:user=>10}'
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'should set assigned_value? message' do
|
34
|
-
build_response
|
35
|
-
@matcher = set_session(:user)
|
36
|
-
@matcher.matches?(@controller)
|
37
|
-
@matcher.failure_message.should == 'Expected session variable user to be set, got {}'
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'should set is_equal_value? message' do
|
41
|
-
build_response { session[:user] = 2 }
|
42
|
-
@matcher.matches?(@controller)
|
43
|
-
@matcher.failure_message.should == 'Expected session variable user to be set to 1, got {:user=>2}'
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
describe 'matcher' do
|
48
|
-
before(:each) do
|
49
|
-
build_response {
|
50
|
-
session[:user] = 'jose'
|
51
|
-
session[:true] = true
|
52
|
-
session[:false] = false
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
+
|
3
|
+
describe 'set_session' do
|
4
|
+
include FunctionalBuilder
|
5
|
+
|
6
|
+
describe 'messages' do
|
7
|
+
before(:each) do
|
8
|
+
@matcher = set_session(:user).to(1)
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should contain a description message' do
|
12
|
+
@matcher = set_session(:user)
|
13
|
+
@matcher.description.should == 'set session variable user'
|
14
|
+
|
15
|
+
@matcher.to(1)
|
16
|
+
@matcher.description.should == 'set session variable user to 1'
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'should set is_not_empty? message' do
|
20
|
+
build_response
|
21
|
+
@matcher = set_session
|
22
|
+
@matcher.matches?(@controller)
|
23
|
+
@matcher.failure_message.should == 'Expected any session variable to be set, got {}'
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should set contains_value? message' do
|
27
|
+
build_response { session[:user] = 10 }
|
28
|
+
@matcher = set_session.to(1)
|
29
|
+
@matcher.matches?(@controller)
|
30
|
+
@matcher.failure_message.should == 'Expected any session variable to be set to 1, got {:user=>10}'
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'should set assigned_value? message' do
|
34
|
+
build_response
|
35
|
+
@matcher = set_session(:user)
|
36
|
+
@matcher.matches?(@controller)
|
37
|
+
@matcher.failure_message.should == 'Expected session variable user to be set, got {}'
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'should set is_equal_value? message' do
|
41
|
+
build_response { session[:user] = 2 }
|
42
|
+
@matcher.matches?(@controller)
|
43
|
+
@matcher.failure_message.should == 'Expected session variable user to be set to 1, got {:user=>2}'
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe 'matcher' do
|
48
|
+
before(:each) do
|
49
|
+
build_response {
|
50
|
+
session[:user] = 'jose'
|
51
|
+
session[:true] = true
|
52
|
+
session[:false] = false
|
53
53
|
session[:nil] = nil
|
54
54
|
session[:array] = [1,2]
|
55
|
-
session[:date] = Date.today
|
56
|
-
}
|
57
|
-
end
|
58
|
-
|
59
|
-
it { should set_session }
|
60
|
-
it { should set_session.to('jose') }
|
61
|
-
it { should set_session(:user) }
|
62
|
-
it { should set_session(:user).to('jose') }
|
63
|
-
|
64
|
-
it { should_not set_session.to('joseph') }
|
65
|
-
it { should_not set_session(:post) }
|
66
|
-
it { should_not set_session(:user).to('joseph') }
|
67
|
-
|
68
|
-
it { should set_session(:user){ 'jose' } }
|
69
|
-
it { should set_session(:user, :to => proc{ 'jose' }) }
|
70
|
-
|
71
|
-
it { should_not set_session(:user).to(nil) }
|
72
|
-
it { should_not set_session(:user){ 'joseph' } }
|
73
|
-
it { should_not set_session(:user, :to => proc{ 'joseph' }) }
|
74
|
-
|
75
|
-
it { should set_session(:true) }
|
76
|
-
it { should set_session(:true).to(true) }
|
77
|
-
it { should_not set_session(:true).to(false) }
|
78
|
-
|
79
|
-
it { should set_session(:false) }
|
80
|
-
it { should set_session(:false).to(false) }
|
81
|
-
it { should_not set_session(:false).to(true) }
|
82
|
-
|
83
|
-
it { should set_session(:nil) }
|
84
|
-
it { should set_session(:nil).to(nil) }
|
55
|
+
session[:date] = Date.today
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
it { should set_session }
|
60
|
+
it { should set_session.to('jose') }
|
61
|
+
it { should set_session(:user) }
|
62
|
+
it { should set_session(:user).to('jose') }
|
63
|
+
|
64
|
+
it { should_not set_session.to('joseph') }
|
65
|
+
it { should_not set_session(:post) }
|
66
|
+
it { should_not set_session(:user).to('joseph') }
|
67
|
+
|
68
|
+
it { should set_session(:user){ 'jose' } }
|
69
|
+
it { should set_session(:user, :to => proc{ 'jose' }) }
|
70
|
+
|
71
|
+
it { should_not set_session(:user).to(nil) }
|
72
|
+
it { should_not set_session(:user){ 'joseph' } }
|
73
|
+
it { should_not set_session(:user, :to => proc{ 'joseph' }) }
|
74
|
+
|
75
|
+
it { should set_session(:true) }
|
76
|
+
it { should set_session(:true).to(true) }
|
77
|
+
it { should_not set_session(:true).to(false) }
|
78
|
+
|
79
|
+
it { should set_session(:false) }
|
80
|
+
it { should set_session(:false).to(false) }
|
81
|
+
it { should_not set_session(:false).to(true) }
|
82
|
+
|
83
|
+
it { should set_session(:nil) }
|
84
|
+
it { should set_session(:nil).to(nil) }
|
85
85
|
it { should_not set_session(:nil).to(true) }
|
86
86
|
|
87
|
-
it { should set_session(:array) }
|
88
|
-
it { should set_session(:array).to([1,2]) }
|
87
|
+
it { should set_session(:array) }
|
88
|
+
it { should set_session(:array).to([1,2]) }
|
89
89
|
it { should_not set_session(:array).to([2,1]) }
|
90
90
|
|
91
|
-
it { should set_session(:date) }
|
92
|
-
it { should set_session(:date).to(Date.today) }
|
93
|
-
it { should_not set_session(:date).to(Date.today + 1) }
|
94
|
-
end
|
95
|
-
|
96
|
-
describe 'macro' do
|
97
|
-
before(:each) do
|
98
|
-
build_response {
|
99
|
-
session[:user] = 'jose'
|
100
|
-
session[:true] = true
|
101
|
-
session[:false] = false
|
91
|
+
it { should set_session(:date) }
|
92
|
+
it { should set_session(:date).to(Date.today) }
|
93
|
+
it { should_not set_session(:date).to(Date.today + 1) }
|
94
|
+
end
|
95
|
+
|
96
|
+
describe 'macro' do
|
97
|
+
before(:each) do
|
98
|
+
build_response {
|
99
|
+
session[:user] = 'jose'
|
100
|
+
session[:true] = true
|
101
|
+
session[:false] = false
|
102
102
|
session[:nil] = nil
|
103
103
|
session[:array] = [1,2]
|
104
|
-
session[:date] = Date.today
|
105
|
-
}
|
106
|
-
end
|
107
|
-
|
108
|
-
should_set_session
|
109
|
-
should_set_session :to => 'jose'
|
110
|
-
should_set_session :user
|
111
|
-
should_set_session :user, :to => 'jose'
|
112
|
-
|
113
|
-
should_not_set_session :to => 'joseph'
|
114
|
-
should_not_set_session :post
|
115
|
-
should_not_set_session :user, :to => 'joseph'
|
116
|
-
|
117
|
-
should_set_session(:user){ 'jose' }
|
104
|
+
session[:date] = Date.today
|
105
|
+
}
|
106
|
+
end
|
107
|
+
|
108
|
+
should_set_session
|
109
|
+
should_set_session :to => 'jose'
|
110
|
+
should_set_session :user
|
111
|
+
should_set_session :user, :to => 'jose'
|
112
|
+
|
113
|
+
should_not_set_session :to => 'joseph'
|
114
|
+
should_not_set_session :post
|
115
|
+
should_not_set_session :user, :to => 'joseph'
|
116
|
+
|
117
|
+
should_set_session(:user){ 'jose' }
|
118
118
|
should_set_session :user, :to => proc{ 'jose' }
|
119
119
|
|
120
120
|
should_set_session :user do |m|
|
121
121
|
m.to { 'jose' }
|
122
|
-
end
|
123
|
-
|
124
|
-
should_not_set_session :user, :to => nil
|
125
|
-
should_not_set_session(:user){ 'joseph' }
|
126
|
-
should_not_set_session :user, :to => proc{ 'joseph' }
|
127
|
-
|
128
|
-
should_set_session :true
|
129
|
-
should_set_session :true, :to => true
|
130
|
-
should_not_set_session :true, :to => false
|
131
|
-
|
132
|
-
should_set_session :false
|
133
|
-
should_set_session :false, :to => false
|
134
|
-
should_not_set_session :false, :to => true
|
135
|
-
|
136
|
-
should_set_session :nil
|
137
|
-
should_set_session :nil, :to => nil
|
122
|
+
end
|
123
|
+
|
124
|
+
should_not_set_session :user, :to => nil
|
125
|
+
should_not_set_session(:user){ 'joseph' }
|
126
|
+
should_not_set_session :user, :to => proc{ 'joseph' }
|
127
|
+
|
128
|
+
should_set_session :true
|
129
|
+
should_set_session :true, :to => true
|
130
|
+
should_not_set_session :true, :to => false
|
131
|
+
|
132
|
+
should_set_session :false
|
133
|
+
should_set_session :false, :to => false
|
134
|
+
should_not_set_session :false, :to => true
|
135
|
+
|
136
|
+
should_set_session :nil
|
137
|
+
should_set_session :nil, :to => nil
|
138
138
|
should_not_set_session :nil, :to => true
|
139
139
|
|
140
|
-
should_set_session :array
|
141
|
-
should_set_session :array, :to => [1,2]
|
140
|
+
should_set_session :array
|
141
|
+
should_set_session :array, :to => [1,2]
|
142
142
|
should_not_set_session :array, :to => [2,1]
|
143
143
|
|
144
|
-
should_set_session :date
|
145
|
-
should_set_session :date, :to => Date.today
|
146
|
-
should_not_set_session :date, :to => (Date.today + 1)
|
147
|
-
end
|
148
|
-
|
149
|
-
describe 'with no parameter' do
|
150
|
-
before(:each) { build_response }
|
151
|
-
|
152
|
-
should_not_set_session
|
153
|
-
it { should_not set_session }
|
154
|
-
end
|
155
|
-
|
156
|
-
generate_macro_stubs_specs_for(:set_session)
|
157
|
-
end
|
144
|
+
should_set_session :date
|
145
|
+
should_set_session :date, :to => Date.today
|
146
|
+
should_not_set_session :date, :to => (Date.today + 1)
|
147
|
+
end
|
148
|
+
|
149
|
+
describe 'with no parameter' do
|
150
|
+
before(:each) { build_response }
|
151
|
+
|
152
|
+
should_not_set_session
|
153
|
+
it { should_not set_session }
|
154
|
+
end
|
155
|
+
|
156
|
+
generate_macro_stubs_specs_for(:set_session)
|
157
|
+
end
|