[rspec-users] Testing file attachment with Paperclip
Deven Patel
lists at ruby-forum.com
Thu Jan 28 23:49:32 EST 2010
Nicholas Wieland wrote:
> Does someone have an example on faking a file upload for just ensuring
> it gets called, without actually uploading the file to s3.
> I thought that stubbing Model.has_attached_file would be enough, but
> it doesn't seem so ...
>
> This is what I did:
>
> Video.stub!( :has_attached_file ).with( :name ).and_return( true )
>
> has_attached_file is from paperclip, it gets mixed to the model.
>
> 1)
> RightAws::AwsError in 'VideosController should create a valid Video'
> AWS access keys are required to operate on S3
> /Users/ngw/zooppa-4/app/controllers/videos_controller.rb:6:in `create'
> /Users/ngw/zooppa-4/spec/controllers/videos_controller_spec.rb:17:
>
> Maybe I missed something ?
>
> TIA,
> ngw
hello dear.....
have u got the solution 4 that...then please tell me...
and second one is, from where u get S3 aws_access_key and
aws_secret_access_key and bucket_base_name .. or from wher to set
this.........
thanks
replay me on deven.patel at trinitywebtech.com
--
Posted via http://www.ruby-forum.com/.
More information about the rspec-users
mailing list