mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-24 17:54:59 -04:00
Merge pull request #285 from Skud/tradable_nowhere
fixed bug with tradable_to reverting to 'nowhere'
This commit is contained in:
@@ -22,7 +22,8 @@
|
||||
.control-group
|
||||
= f.label 'Will trade:', :class => 'control-label'
|
||||
.controls
|
||||
= f.select(:tradable_to, options_for_select(Seed::TRADABLE_TO_VALUES, 'nowhere'))
|
||||
= f.select(:tradable_to,
|
||||
options_for_select(Seed::TRADABLE_TO_VALUES, :selected => @seed.tradable_to || 'nowhere'))
|
||||
%span.help_inline
|
||||
- if current_member.location.blank?
|
||||
Don't forget to
|
||||
|
||||
@@ -19,4 +19,11 @@ describe "seeds/edit" do
|
||||
assert_select "select#seed_tradable_to", :name => "seed[tradable_to]"
|
||||
end
|
||||
end
|
||||
|
||||
it "doesn't revert tradable_to to nowhere" do
|
||||
@seed = FactoryGirl.create(:tradable_seed, :owner => @member)
|
||||
@seed.tradable_to.should_not eq "nowhere"
|
||||
render
|
||||
assert_select "option[selected=selected]", :text => @seed.tradable_to
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user