Displaying 20 results from an estimated 7000 matches similar to: "user engine: Role.count() is zero in tests"
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 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
2006 Jan 11
14
User Engine/General Engine issues
I''m trying to get the login/user engine combo up and working and am
having difficulties. I got the login engine up and running fine, no
problems. Now, on to the user engine.
After fixing the needed stuff in the bootstrap task so it loads I''m
able to login as the default admin ok. BUT none of the
views/controllers that are in login/user_controller are being
overridden by the
2006 Apr 28
2
tests and login_engine
Hi there,
I just started writing tests today after some months of using rails (slap wrists).
I seem to be getting the hang of things, but I''m hitting a wall when it comes to functional_testing pages protected by login_engine/user_engine.
all my assertions come back with:
Expected response to be a <:success>, but was <302>
Is there a way I can login from within a test?
2007 Feb 13
16
Error against latest trunk while testing via spec for model
Hi
I just did an update to lates trunk
=================
context "Given a generated venue_spec.rb with fixtures loaded" do
fixtures :venues
specify "fixtures should load two Venues" do
Venue.should have(2).records
end
end
==================
gives me
==========
1)
TypeError in ''Given a generated venue_spec.rb with fixtures loaded
fixtures should load two
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/" #
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.
2005 Dec 31
9
Railspdf plugin problem
Hi,
For my app i need to generate pdf file for reports. I am trying the railspdf
plugin, got it installed using command:
ruby script/plugin install
svn://rubyforge.org//var/svn/railspdfplugin/railspdf/
The problem is that when i re-started my webrick it won''t run, with errors
messages like this (shown only first message):
*D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.5
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/.
2007 Jan 05
4
How To Spec Controllers with Finders
Given this code (which renders rjs), I''m faced with the fixture-
driven way of spec-ing or mocking. How the heck to you mock this so
the code at line (2) and (4) work right? I''m still struggling with
mocks but it seems like this can be done. Forgive the naivety of this
question.
1. def change_quantity
2. @line_item = LineItem.find_by_id(params[:id])
3. unless
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 Jul 09
12
Mocking User.find( :all, :limit => 10 )
Hi,
I''m trying to setup a mock for my controller test but I can''t get it to
recognise the mock.
I use
it "should find all users" do
User.should_receive(:find).with( :all, :limit => 10
).and_return([@user])
do_get
end
and in the controller
@users = User.find(:all, :limit => 10 )
But this does not work. It gives me
User expected :find with (:all)
2007 Aug 23
6
controller spec with model that validates_uniqueness
I want to use mocks and stubs to test the controller, but am having
trouble getting my validation not to trigger. Here''s the code:
# spec:
Image.stub!(:find).and_return(@image)
@image.should_receive(:save!).once.with(:any_args)
put :update, :id => @image.id, :category_id =>
@category.id, :image => {:name => ''test'', :image_number =>
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?
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
2006 Jan 07
3
user engine question
I''ve created an array of hashes in UserController#initialize to describe
a menu:
@menu_array = [
{:menu => ''home'', :controller => ''home'', :action => ''send_home''},
{:menu => ''user list'', :action => ''list''},
{:menu => ''login'', :controller =>
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
2007 Apr 30
4
Mocking with Calculated Results
I am setting up an AR mock object and wanted to sanity check it. My
intent is to mix this into all my examples and then override/add
methods where necessary. Note that I''ve anticipated three cases for
find:
find with one numeric argument => object
find with :all => Array
find with anything else => nil
This roughly approximates how ActiveRecord::find works in this case
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'',
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: