Displaying 20 results from an estimated 23 matches for "fixture_path".
2012 Jun 08
1
[Rails 3.2.5] Rails: unit test fixture_path : fixture_file_upload cannot find the file ...
I am trying to perform a test unit, using FactoryGirl
include ActionDispatch::TestProcess
FactoryGirl.define do
factory :article do
.......
photo { fixture_file_upload ''/files/test.jpg'', ''image/jpg'' }
end
end
IN mt test_helper.rb I defined the fixture_path
def fixture_path
File.dirname(__FILE__) + "/fixtures/" # "..../myapp/test/
fixtures/"
end
and I have my test.jpg in "..../myapp/test/fixtures/files/
test.jpg"
but running the unit test, article = FactoryGirl.build(:article,
title: nil), I get an erro...
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.
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
2006 Jan 24
0
Fixtures subdirectories
...n?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"
fixtures :customers, :partners
Test::Unit::TestCase.fixture_path = RAILS_ROOT + "/test/fixtures/catalog"
fixtures :products, :parts
However, it looks like the test_help.rb file (in <rails>/lib) which is
written as:
Te...
2008 Dec 03
5
How to test a plugin
...ect to our plugin test database
ActiveRecord::Base.establish_connection(databases[ENV[''DB''] || ''mysql''])
# Load the test schema into the database
load(File.join(plugin_test_dir, ''schema.rb''))
# Load fixtures for the plugin
Test::Unit::TestCase.fixture_path = File.join(plugin_test_dir,
''fixtures/'')
</code>
Thanks much!
Arthur
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"...
2007 Apr 30
7
Migrating spec_helper with modifications
Hello,
After moving into the HEAD of rspec, I am greeted with a mountain of errors,
which I expected, due to my specs not being migrated.
I use hpricot for a lot of my view tests, as it is extremely simple to
traverse the DOM with it. I used to include HpricotSpecHelper in
spec_helper.rb, like so:
require ''hpricot_spec_helper''
module Spec
module Rails
module Runner
2007 Mar 15
5
rake spec:views no transaction error
Hello,
I have recently upgraded to the 0.8.2 release of rSpec, and I am receiving
the following message with each view spec execution:
WARNING: there is no transaction in progress
I have upgraded the rspec_on_rails plugin as well, and both the model and
controller tests are working flawlessly. Is there some simple step I
missed? thanks for the input.
-Chris
-------------- next part
2007 Sep 10
1
Using Rspec with ScenarioFixtures
I am currently trying to get Rspec to work with ScenarioFixtures.
http://code.google.com/p/fixture-scenarios/
http://errtheblog.com/post/7708
I did a quick search and didn''t find any mention that any one else had
gotten this to work yet. If i missed something, could you please drop me a
line.
Otherwise, expect a progress report when i get this working...
Bret
-------------- next part
2011 Aug 10
1
How to stop Rspec loading my Cucumber fixtures
...;*.yml'')].map {|f|
File.basename(f, ''.yml'') }
Fixtures.create_fixtures(fixtures_folder, fixtures)
So far so good. Cucumber still loads the fixtures I moved as planned.
But Rspec is still loading them too! This is despite `spec/spec_helper.rb`
saying:
config.fixture_path = "#{::Rails.root}/spec/fixtures"
I have tried setting the following in `spec/spec_helper.rb`:
config.use_transactional_fixtures = false
However, it doesn''t work. And it wouldn''t be a long-term solution anyway, as
I may need fixtures in Rspec in the future.
H...
2006 Nov 25
2
RSpec 0.7.3
Hi all,
I just released RSpec 0.7.3. It''s got a few bug fixes and the rails
plugin *should* run against both Rails 1.1.6 and 1.2.0-RC1.
If you run into problems, please report bugs and feature requests in
the tracker at rubyforge:
http://rubyforge.org/tracker/?group_id=797
Cheers,
David
2008 Feb 18
5
uh... fixtures?
...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:
config.use_transactional_fixtures = true
config.use_instantiated_fixtures = false
config.fixture_path = RAILS_ROOT + ''/test/fixtures/''
# borrow existing ones ^
config.global_fixtures = :posts, :topics, :users
And here''s a Beast test translated into a spec:
describe Post do
fixtures :forums, :moderatorships, :monitorships, :posts, :topics, :users...
2005 Dec 17
4
user engine: Role.count() is zero in tests
Subject pretty much says it all. When user_engine#check_system_roles is
called, it discovers that Role.count is zero. However using
script/console to execute the same query reveals three users.
N.b., this does not happen in the actual application; only when running
tests.
Any help is appreciated.
Thx
--
Posted via http://www.ruby-forum.com/.
2011 Feb 25
7
Rspec2 for rails 2.3.8?
Hi experts,
I picked up a copy of the rspec book and wrote some tests in spec/lib
and spec/models for my Rails 2.3.8 code.
I was using rspec 2.5.1, rspec-core 2.5.0, rspec-expectations 2.5.0 et.
al.
But I realised that the rspec-rails version I am using is meant for
Rails3.
Which version of rspec-rails should I use for Rails 2.3.8?
Best,
Radhesh
--
Posted via http://www.ruby-forum.com/.
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
2006 Jul 13
0
Loading different fixtures?
...d there didn''t get me
the expected behavior (perhaps it was taken back out again?).
Similarly, the patch from ticket 1911 is against 0.13.1; I''d be
surprised if it worked on 1.1...
I''ve also tried the following:
class RolldownTest < Test::Unit::TestCase
self.fixture_path =
"#{File.dirname(__FILE__)}/../fixtures/rolldown/"
fixtures :authorizations, :timecards #, etc
#...
end
This works when I just run the test as a standalone, but it utterly
hoses all other tests when I run rake.
Any other suggestions?
Thanks,
-Sam
--
Posted via http://ww...
2006 May 23
2
Putting fixtures into subdirectories
I want to organize my fixtures just like the namespace of my models. So
for example if I have a model Company::Employee I''d like the fixture to
be in fixtures/company/employees.yml.
However, I can''t figure out how to specify the path of the fixture file.
If I do:
fixtures :employees
in my unit test it can''t find the fixture file. Any suggestions?
Thanks,
Todd
2007 Sep 27
0
fixture_scenarios in trunk
...lib/spec/rails/dsl/behaviour/
rails_example.rb:27:in `before_eval''
At the moment I am only using global fixtures for one model, I have
tried removing this line and its still the same error.
config.global_fixtures = :sites
and I have added the trailing slash to my fixture path
config.fixture_path = RAILS_ROOT + ''/spec/fixtures/''
Anyone got any pointers on getting this running? This particular
application uses railsengines (both rails and engines are gem
versions of 1.2 (rails 1.2.3))
Thanks,
David
2007 Jun 21
0
Testing a Rails plugin
...t/config/environment.rb''
# Run the migrations
ActiveRecord::Migrator.migrate("#{RAILS_ROOT}/db/migrate")
require ''spec/rails''
Spec::Runner.configure do |config|
config.use_transactional_fixtures = true
config.use_instantiated_fixtures = false
config.fixture_path = File.dirname(__FILE__) + "/fixtures/"
config.before(:each, :behaviour_type => :controller) do
raise_controller_errors
end
end
--------------
It all seems to be working, but I haven''t kicked the tires to hard yet.
Just thought I''d run this setup by you f...
2007 Apr 17
3
using rake db:fixtures:load with rspec fixtures
Hi, I''m new to rspec. I have some fixtures in /spec/fixtures. If they
were in /test/fixtures they could be loaded with rake db:fixtures:load.
Is there any way other than a symlink to load my rspec fixtures into
the database with rake? Or, can I cause rspec to load the fixtures
from /test/fixtures?
Thanks,
Paul
2011 Aug 09
0
Devise, RSpec and Webrat
...prevents webrat from opening the
browser
end
# Uncomment the next line to use webrat''s matchers
require ''webrat/integrations/rspec-rails''
Spec::Runner.configure do |config|
config.use_transactional_fixtures = true
config.use_instantiated_fixtures = false
config.fixture_path = RAILS_ROOT + ''/spec/fixtures/''
include Webrat::Methods
#config.include Webrat::Matchers, :type => :views
end
My spec:
require ''spec_helper''
describe "Campaign" do
describe "in first step" do
before(:each) do
@user = Fac...