Ramon Tayag wrote:
> I suggest doing those tests in the model, not in the controller. Just
> do that fixture thing for the controller spec to pass. But pass the
> same thing in the model. Here's a sample of how I do it
>
> require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
>
> describe ProductImage do
> before(:all) do
> @valid_attributes = {
> :uploaded_data => fixture_file_upload("100x100.jpg",'image/jpg'),
> :product_id => 1
> }
> @product_image = ProductImage.create(@valid_attributes)
> end
>
> it "should create a new instance given valid attributes" do
> ProductImage.create!(@valid_attributes)
> end
> end
>
> Ramon Tayag
Can I know what the create action handle.
I am getting undefined method 'create' error
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users