Displaying 20 results from an estimated 3000 matches similar to: "Should fixtures be transactional?"
2007 Aug 16
17
undefined method `mock_model'' for [RSpec example]:#<Class:0x25550a8>
I am getting:
undefined method `mock_model'' for [RSpec example]:#<Class:0x25550a8>
with my view specs after upgrading to 1.0.8. Is anyone else seeing this?
To isolate the message I did the following setup:
- create new rails project (with edge)
- installed rspec and rspec_on_rails
- ran rake spec
- ran script/generate rspec_scaffold products
- tried to run a builtin view
2007 May 07
7
Installing plugins without svn:// access
Hi,
I''m trying to get up and running with rspec on a new project. I''d like to
install the rspec and rspec_on_rails plugins (per
http://rspec.rubyforge.org/documentation/rails/install.html), but my
corporate firewall blocks port 3690 so I can''t access the repository via
svn://
I searched the docs and the mailing-list archive to figure out how to
install the plugins
2007 Aug 27
7
Foreign key constraints, fixtures, and rake task
I''ve got a spec that loads a fixture in the "before" block. This works
fine running scripts/spec, but when I run rake spec instead, I get:
ActiveRecord::StatementInvalid in ''User in fixture :quentin with an IM
service but no IM name should be invalid''
Mysql::Error: Cannot delete or update a parent row: a foreign key
constraint fails
2007 Aug 13
2
Backtrace tweaker - broken or me?
Using 1.0.8, I just realized that I''ve been scrolling through pages of
backtraces when rspec is supposed to clean them up for me. This is a
new development machine, so I''m not sure if older versions worked or
not. I''m running Ruby 1.8.6, Rails edge, Mac OS X 10.4.10.
I''ve verified that the QuietBacktraceTweaker is the one that''s running.
2006 Nov 07
7
should_redirect_to in advance - feels unnatural
I can understand that it''s easier for rspec to set up a mock in advance
of the controller call. But it makes it difficult to do something like:
context "The HarkController, given Louie the logged-in user" do
setup do
post :login, :username => ''louie'', :password => ''atest''
end
specify "should redirect Louie to the home
2007 Aug 06
2
Specifying custom rails FormBuilders
I want to write a spec for a custom form builder, but I''m not really
sure where it should live or how to include the right rspec_on_rails
contexts. Ideally, I should be able to write a spec like:
describe LabelledBuilder do
it "should let me create a text field" do
object = mock(object)
object.stub!(:attribute).and_return("Test String")
render
2007 Oct 15
14
Top Quoting?
Sort of off-topic and don''t mean to complain, but many on this list
use top quoting. That works ok if you don''t quote the whole previous
thread. However, I''m finding that scrolling forever to locate the
reply on longer threads is getting tedious. What''s the rationale for
top-quoting?
Thx.
2006 Nov 07
1
RSpec/Selenium start_browser_once patch?
The 0.7.0 vendor/selenium/README.txt references a
"start_browser_once.patch" file. This doesn''t seem to be included in
either the rspec or selenium-rc distributions, and Google finds
nothing... where might I find that patch?
Jay Levitt
2006 Nov 10
3
Stubbing Time.now in trunk
I''m a big fan of stubbing Time.now so it returns a known value. I used
to be able to use stubba and say:
@time_now = Time.parse("Jan 1 2001")
Time.stubs(:now).returns(lambda{@time_now})
However, something in trunk broke that. Fine, rspec''s got its own
stubbing lib now, so I tried switching to that:
@time_now = Time.parse("Jan 1 2001")
2007 Feb 27
8
Using a subversion repository to spec in a rails app
Is it a bad practice to use a subversion repository to the trunk of
rspec and rspec_on_rails? Or rather, is it doomed to fail, since my
gem will always be out of date?
I know I can''t use spec, installed from gem,s if I have the latest
revision of rspec and rspec_on_rails checked into my plugins
directory. But I should still be able to use it with the --drb
option, correct?
2007 Apr 25
9
Running specs for a plugin - undefined method ''define'' for object
I''m trying to write specs for a plugin I''m developing named audit_fu, and
I''m running into a problem which I can''t get past it. I''ve got the same
specs setup in the main rails app, and everything works fine there, it''s
just running the plugin specs that I''m having a problem with. My setup is:
- edge rails
- edge rspec (in
2007 Apr 04
11
ANN: RSpec 0.9.0 beta-1 available for download.
We''d like to get some feedback on RSpec 0.9 before we start pushing
out releases via Rubyforge''s gem server and update the website. We
have therefore made the first beta of 0.9 available - both prepackaged
and tagged in subversion (see below).
RSpec 0.9 introduces a new API for expectations, which essentially
means that your underscores go away (there has been other discussions
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 May 02
13
RSpec 0.8.2 pain, missing spec/rails?
Hi. I''m upgrading a project from an 0.8.0 pre-release gem to 0.8.2.
I''ve installed the 0.8.2 gem, and the rspec_on_rails 0.8.2 plugin:
ruby script/plugin install
svn://rubyforge.org/var/svn/rspec/tags/REL_0_8_2/rspec
When I try to run my specs though, I get the below error. It''s as if the
spec_helper cannot find "spec/rails". I''ve noticed that
2007 Apr 09
10
changes in 0.8 and greater - should_
Has the should_... syntax changed? I''m getting errors when running
the following:
should_render(:index)
should_be_valid
should_not_be_valid
should_respond_to
should_be
should_render
I thought the syntax changed to something like the following:
obj.should render(:index)
but this doesn''t seem to work.
Scott
2007 May 01
7
RSpec 0.9.1 released
The RSpec team is pleased to announce RSpec 0.9.1 (we skipped 0.9.0).
RSpec is a framework that provides programmers with a Domain Specific
Language to describe the behaviour of Ruby code with readable,
executable examples that guide you in the
design process and serve well as both documentation as tests.
This release includes a complete overhaul of the API, which can be
summarised as follows:
*
2007 Feb 28
2
Fixture name not available as class variable in spec
Hi there,
I can''t seem to access the fixture name as a class variable from my
specs. I have to set the variable in the spec setup.
... [fixtures]
my_fixture:
id: 1
... [rpsec]
@my_fixture.id.should == 1
... [error]
You have a nil object when you didn''t expect it!
The error occurred while evaluating nil.id
... [my setup]
RSpec-0.7.5.1 (r1395) - BDD for Ruby
Rails
2007 Sep 20
4
alias :calling :lambda
Sprinkling my examples with ''lambda'' has always seemed like a bit of a
wart to me. I''ve gotten into the habit of adding ''alias :calling
:lambda'' to my spec suites. My examples then look like:
calling { Foo }.should raise_error
calling { Bar }.should_not raise_error
Is there a reason that RSpec core has chosen not to make exception
expectations more
2007 Feb 26
15
drbspec - "no server running"
At times I''ve gotten the message "No Server Running" from drbspec
with my rails app. The thing is, the drb server certainly is running!
This happened a few times with my model specs. I''m not sure exactly
what the problem was there - I believe I was loading up fixtures that
didn''t exist. I was calling fixtures :singular_table_name as opposed
to
2007 Jan 21
35
Collection proxies need to be stubbed ?
Hi all !
I just started writing specs on a new project. I would just like to
validate that this is the way you would write it. I know about mocks,
stubs and expectations. I don''t think this is a problem for me.
My question really boils down to:
def index
@projects = current_user.projects.active
end
My spec needs to return the proxy, no ? Here''s my code:
context "A