Permalink
Browse files

The forms helper fix for Rails 3.1

  • Loading branch information...
1 parent 1887e69 commit 6073cba402ee2f4e074084c92240569e6ab488be @MadRabbit committed Nov 10, 2011
Showing with 6 additions and 6 deletions.
  1. +6 −6 spec/lib/right_rails/helpers/forms_spec.rb
@@ -151,11 +151,11 @@ def rightjs_required_files
it "should generate a slider with options" do
model = {}
- model.should_receive('method').twice.and_return(22)
- should_receive(:instance_variable_get).twice.with('@object').and_return(model)
+ model.should_receive('method').and_return(22)
+ should_receive(:instance_variable_get).with('@object').and_return(model)
slider('object', 'method', :value => 22, :min => 20, :max => 80).should ==
- %Q{<input id="object_method" name="object[method]" type="hidden" value="22" />\n}+
+ %Q{<input id="object_method" name="object[method]" type="hidden" />\n}+
%Q{<script type="text/javascript">\n//<![CDATA[\n}+
%Q{new Slider({max:80,min:20,value:22}).insertTo('object_method','after').assignTo('object_method');\n}+
%Q{//]]>\n}+
@@ -166,11 +166,11 @@ def rightjs_required_files
describe ".rater" do
it "should generate a simple rater" do
model = {}
- model.should_receive('method').twice.and_return(2)
- should_receive(:instance_variable_get).twice.with('@object').and_return(model)
+ model.should_receive('method').and_return(2)
+ should_receive(:instance_variable_get).with('@object').and_return(model)
rater('object', 'method', :value => 2).should ==
- %Q{<input id="object_method" name="object[method]" type="hidden" value="2" />\n}+
+ %Q{<input id="object_method" name="object[method]" type="hidden" />\n}+
%Q{<script type="text/javascript">\n//<![CDATA[\n}+
%Q{new Rater({value:2}).insertTo('object_method','after').assignTo('object_method');\n}+
%Q{//]]>\n</script>}

0 comments on commit 6073cba

Please sign in to comment.