Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: hudson-gev-art/formtastic
...
head fork: hudson-gev-art/formtastic
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Showing with 19 additions and 0 deletions.
  1. +19 −0 spec/inputs/select_input_spec.rb
View
19 spec/inputs/select_input_spec.rb
@@ -316,7 +316,26 @@
end
end
end
+
+ describe 'for a has_one association' do
+ before do
+ ::Post.stub!(:reflect_on_association).with(:author).and_return do
+ mock = mock('reflection', :options => {}, :klass => ::Author, :macro => :has_one, :foreign_key=>'post_id')
+ mock
+ end
+ end
+ it "should render some Authors as options" do
+ concat(semantic_form_for(@new_post) do |builder|
+ concat(builder.input(:author, :as => :select))
+ end)
+ output_buffer.should have_tag("li#post_author_input")
+ output_buffer.should have_tag("label", /Author/)
+ output_buffer.should have_tag("select[name='post[author_id]']")
+ output_buffer.should have_tag("select option", "Fred Smith")
+ end
+ end
+
describe 'for a has_many association' do
before do
concat(semantic_form_for(@fred) do |builder|

No commit comments for this range

Something went wrong with that request. Please try again.