radiant-forms-extension 3.3.1 → 3.3.2

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/VERSION CHANGED
@@ -1 +1 @@
1
- 3.3.1
1
+ 3.3.2
@@ -316,6 +316,14 @@ module Forms
316
316
  nil
317
317
  end
318
318
 
319
+ desc %{
320
+ Retrieves a parameter from the url
321
+ }
322
+ tag 'param' do |tag|
323
+ key = tag.attr['name']
324
+ tag.locals.page.params[key]
325
+ end
326
+
319
327
  end
320
328
  end
321
329
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{radiant-forms-extension}
8
- s.version = "3.3.1"
8
+ s.version = "3.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["dirkkelly"]
@@ -35,6 +35,7 @@ describe Forms::Tags::Core do
35
35
  'response:if_get',
36
36
  'response:unless_get',
37
37
 
38
+ 'param',
38
39
  'index',
39
40
  'reset'
40
41
  ].sort
@@ -133,7 +134,7 @@ describe Forms::Tags::Core do
133
134
  it 'should require the name attribute' do
134
135
  tag = %{<r:form:radios />}
135
136
  @page.should_not render(tag)
136
- end
137
+ end
137
138
 
138
139
  end
139
140
 
@@ -147,6 +148,27 @@ describe Forms::Tags::Core do
147
148
 
148
149
  end
149
150
 
151
+ context 'params' do
152
+
153
+ before :each do
154
+ @page = pages(:home)
155
+ end
156
+
157
+ it 'should return the parameter' do
158
+ stub(@page).params { {'token'=>'success'}}
159
+ tag = %{<r:param name='token' />}
160
+ exp = %{success}
161
+ @page.should render(tag).as(exp)
162
+ end
163
+
164
+ it 'should return nil on a missing parameter' do
165
+ tag = %{<r:param name='broken' />}
166
+ exp = %{}
167
+ @page.should render(tag).as(exp)
168
+ end
169
+
170
+ end
171
+
150
172
  context 'response' do
151
173
 
152
174
  context 'conditionals' do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-forms-extension
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 3
8
8
  - 3
9
- - 1
10
- version: 3.3.1
9
+ - 2
10
+ version: 3.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - dirkkelly