similar to: [Rails 3.2.5] Rails: unit test fixture_path : fixture_file_upload cannot find the file ...

Displaying 20 results from an estimated 500 matches similar to: "[Rails 3.2.5] Rails: unit test fixture_path : fixture_file_upload cannot find the file ..."

2007 Nov 09
9
fixture_file_upload and edge rspec?
Hi all, I had some specs that were using fixture_file_upload that were passing just fine. Then I froze edge rails to get some 2.0 functionality, then a I upgraded to trunk rspec to deal with uninitialized constant ActionView::Helpers::JavaScriptMacrosHelper After a couple other of tribulations, I have now gotten down to just a couple of not passing specs, all using the fixture_file_upload.
2014 Feb 18
0
How to Test Multimodel Paperclip attachments?
I'm using Rspec and FactoryGirl to create specs for multimodel paperclip attachments. From searching other questions, it seems like a single image attachment is more common. Car.rb class Car < ActiveRecord::Base has_many :uploads, dependent: :destroy validates :uploads, presence: { message: 'You must upload at least one image' }
2012 Nov 08
1
validates_uniqueness_of(*attr_names) w scope not working in unit test
Rails 3.2.8 Very strange , it works in dv mode console , but not in a unit test class User < ActiveRecord::Base belongs_to :subdomain validates_uniqueness_of :email, :scope => :subdomain_id class UserTest < ActiveSupport::TestCase def initialize_user @booboo = FactoryGirl.create(:subdomain, name: "booboo") @coocoo = FactoryGirl.create(:subdomain, name:
2011 Aug 31
5
3.1rc8 - posting files in a test no longer works
A previously working test, that posted a file object no longer works in the latest 3.1. The test looks like this: params[:media][:new_attachment] = File.open("#{Rails.root}/test/data/ less_than_100.png") post :create, params In the controller, I obviously expect params[:media][:new_attachment] to be a File object - and it used to be. Now it looks like #inspect has been called on the
2013 Oct 08
1
Trouble with rspec and FactoryGirl Sequence
I''m following Michael Hartl''s Ruby on Rails 3 Tutorial but I''m using Rails 3.2.8 and FactoryGirl 4.2.0 and rspec 2.14.1 I''m in chapter 10 trying to generate tests for pagination (using will_paginate 3.2.5 which works fine in dev) I can get FactoryGirl to test just fine if I don''t use Sequence but I can''t seem to figure out the correct syntax
2013 Aug 22
1
How do I deal with ActiveRecord::RecordInvalid: Validation failed:
Hello all, I am currently writing model tests in rails 4. I am attempting to add an error to a reservation object if the total number of reservations for a given date and time has reached a pre-determined limit. When my test runs, it is hitting the appropriate code but it is raising the following error as opposed to just giving me an error in the object that I can use.
2013 Feb 28
1
Validation Failed: Userkey has already been taken, Email has already been taken
Hi, I am using Factory girl with rspec and capybara for testing my rails appliction. I have the below code FactoryGirl.define do factory :user do |f| f.email "sss1 at gmail.com" f.userkey "12ssd345q62" end end When I run the test it is failing as "Validation Failed: Userkey has already been taken, Email has already been taken". What could be the reason for
2008 Jan 21
5
attachment_fu and story runner, any updates
I''m trying to write a story for a Rails app which involves using the attachment_fu plugin to upload images. After blunting my pick on this for a while, google found me this: http://www.ruby-forum.com/topic/134743#600831 So it seems that there''s a hole in Rails integration testing and multipart form posting. David offered to incorporate a patch to story runner at the end of the
2012 Nov 18
3
remarkable activerecord association RSpec
i''m using gem Remarkable activerecord for association. i''ve installed remarkable and remarkable activerecrod both gem. i''ve added both gem in my Gemfile. i''ve added "remarkable_activerecord" as required in spec_helper.rb. describe Authentication do FactoryGirl.build(:authentication).should belong_to(:user)
2012 Nov 12
7
RSpec: controller POST create
Rails 3.1.3 rspec-rails (2.11.4) rspec 2.11.1 I am new to rspec. I don''t quite understand tests for POST create part. I have generated scaffold, and simultaneously it generated controller_spec.rb as well. it "assigns a newly created plan as @plan" do post :create, {:plan => valid_attributes}, valid_session assigns(:plan).should be_a(Plan)
2013 Jun 18
1
Getting rspec error: Net::SMTPServerBusy: Relay access denied
I''m trying to test registration emails (sent with devise), and I keep getting the error: Net::SMTPServerBusy: 454 4.7.1 <model_spec-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org>: Relay access denied I''m running Rails 3.2.11 with Capybara, and I have (temporarily) chopped my spec_helper.rb and test.rb files down to the bare minimum, still getting the error above.
2006 May 01
10
large file storing in postgres sucks?
Hi, I''m not sure if this is a postgres issue or not, but I''m using Postgres 8.1. I have (in my functional tests) the following code: upload = fixture_file_upload(''/files/podcast.mp3'', ''audio/mpeg'') post :create, :product => valid_product, :media => { :image => upload } And then in the controller: blob = Blob.create :data
2008 Dec 03
5
How to test a plugin
Guys, I''ve created a plugin, i wanna put my automated test there. However, I got bad file descriptor error when i run the test like normal unit test file: "ruby plugins/acts_as_fox/test/acts_as_fox_test.rb" How to test a plugin? Also, is it right to say that I should only put my unit tests (but not functional test for example) for the plugin in the plugin test folder?
2011 Aug 10
1
How to stop Rspec loading my Cucumber fixtures
I have a bunch of fixtures designed to populate the database for my Cucumber integration tests. But at this stage I want my database to be empty when using Rspec. So, I moved the fixtures from `/spec/fixtures` to `features/support/fixtures`, and updated `features/support/env.rb` to read: Fixtures.reset_cache fixtures_folder = File.join(RAILS_ROOT, ''features'',
2006 Nov 24
13
rSpec on Rails 1.2?
I just updated my Rails install to the most current Edge and my controller specs fail: 1) TypeError in ''The User Controller should be a user controller'' can''t convert nil into String Each spec fails the same way. <context string> <spec string> can''t convert nil into String Any ideas what''s up with this? Thanks, s.ross
2008 Feb 18
5
uh... fixtures?
RSpec-ers: I''m aware this is quite the FAQ. I have probably asked it myself, but I just can''t Google up anything but others asking it. I grabbed the source to Beast, to use as a Rails project uninfluenced by me, or RSpec. Then I installed the CURRENT version of RSpec and rspec_on_rails, and set up a model spec on Post. Here''s the spec_helper.rb lines:
2006 Jan 24
0
Fixtures subdirectories
Hi, [This is a repost, I can?t find where went my previous post, ] I wanted to create subdirectories in the fixtures directory in order to be able to manage many different initial states for my system (or to sort fixtures / corresponding model subpackages). I came up with the idea of writing: Test::Unit::TestCase.fixture_path = RAILS_ROOT + "/test/fixtures/selling"
2013 Sep 04
2
Speed up image processing of Paperclip in Acceptance Tests
Hi All, I have a question here: How to Speed up image processing of Paperclip in Acceptance Tests When running capybara feature specs I can see lots of Slow factory notices which are populated byfactory_girl. These Slow factory things heavy slow down the feature specs, I think, even feature specs are intrinsic slow specs. Then I had some inspect and found out most of the Slow factory was
2007 Dec 11
14
Attachment-fu + Story Runner
Hi all, I''m trying to run a Story Runner integration test that uploads a file through Attachment-fu. I''ve tried various ways of specifying the file data, from custom mocks: class MockFile < Struct.new (:original_filename, :read, :content_type); end fdata = MockFile.new "test_upload.txt", "Test Upload", "text/plain" to
2012 Jun 08
0
Having difficulty testing redirects with Rspec and Capybara
Every time I try to test a redirect, I get this error: @request must be an ActionDispatch::Request Any idea why? I''m using Rspec-Rails 2.9.0, Capybara 1.1.2, and Rails 3.2. Here''s my test: describe "AdminAccountPages" do subject { page } let(:user) { FactoryGirl.create(:user) } let(:account) { user.owned_accounts.create!(name: "ACME Corp",