How to test a rails model that accepts nested attributes with Cucumber


How to test a rails model that accepts nested attributes with Cucumber



How do you test a model Topic that accepts nested attributes for an Image?

Given /^I have topics titled (.+)$/ do |titles|     path ="#{RAILS_ROOT}/features/upload-files/"      image = File.new(path + "image.jpg")     titles.split(', ').each do |title|     	Topic.create!(:title => title, :image => File.new(image) ) # this doesn't work!     end end 



Multi-stage deployment advice?

1:



Strip Inline CSS and JavaScript in Rails
Topic.create!(:title => title, :image_attributes => {:image => File.new(image) } ) # this works! 


Rails has_many with alias name


78 out of 100 based on 58 user ratings 258 reviews