Displaying 20 results from an estimated 30000 matches similar to: "RSpec''d plugin in a non-RSpec rails app?"
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
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 06
1
Integration testing: coupling of get and post on forms
This is such a vague request it''s not even worthy of a ticket, but:
When rspec does support integration testing, it''d be really nice to be
able to do things like this plugin does for standard Rails tests:
http://www.jasongarber.com/articles/2006/10/24/easier-testing-of-forms-form_test_helper
In a nutshell, it finally closes the loop between "the empty form sent
by a
2007 Sep 16
10
I lost the RSpec fight
I''ve been working on a Rails project with one other developer; he was
using Test::Unit, and I was using RSpec. That works OK for a while, but
obviously it starts causing pain when you have to check in two places to
see if a piece of code is properly tested/spec''d, you can''t use TextMate
shortcuts to switch back and forth between code and test, you have to
duplicate
2006 Oct 17
3
Should fixtures be transactional?
I started using the new Model.should_have(1).records expectation in
rspec_on_rails, and quickly realized that my fixtures were remaining
loaded, even in contexts that didn''t use them. Bug or feature?
Jay Levitt
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 02
2
got/expects causes mental layering violation
I was, for the first time, spec''ing a class that redefined ==. And my
spec was incorrect, so == was returning false.
The result was something like:
class C
def ==(other)
false
end
end
.. C.new.should == other...
expected other, got #<C:0x7f03c454> (using ==)
But wait! Why on earth is == returning the class itself instead of
true/false? That shouldn''t be
2006 Nov 07
1
Should Selenium support be doing rollbacks?
Now that 0.7.0 is forcing me to write properly compartmented specs, I
thought I''d give the "dead easy Selenium support" a try.
Is it supposed to all the things that rspec normally does for me, or is
it just for using rspec-like grammar to surround Selenium tests?
Specifically, should it roll back the database between specifications?
I just did a quick test, and the result
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
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")
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 Jan 15
2
heckle and rspec on rails
Now that I''m developing a big suite of specs, I really want to run
Heckle and see how well I''ve done.
Using r1359, when I run:
spec spec/models/metadata_report_spec.rb --heckle MetadataReport
the result is just to run the specs once and then exit, as though I
hadn''t mentioned Heckle. I started looking though rspec to figure out
why, but it''s late, so I should
2006 Oct 15
0
DRb delays using rails_spec_server?
I''ve been successfully using rails_spec_server for some time. Somehow,
in the process of deleting and recreating my rspec directory a few times
for SVN (or, less believably, in the process of building SVN 1.4.0 and
its dependencies), something got hosed. Now, script/rails_spec takes
5-10 seconds to get past DRb.start_server. This is on a fast Windows
machine under cygwin.
Anyone
2011 May 22
0
Trying to get rspec-rails working.
Hi,
I have a rails 2.3.3 app I am migrating to 2.3.11. In the process I
am adding bundler support.
When I add rspec and rspec rails (1.3.4) to my gemfile, then try to
install rspec-rails per the instructions (here https://github.com/dchelimsky/rspec/wiki/rails)
using the config.gem method link, I can''t get the script/generate
rspec command to work (I am told rspec generator not
2007 Sep 04
16
Failure Messages in RSpec
Having used JUnit and Test::Unit, I''m quite used to having the ability to
insert a failure message, which helps when tests fail.
For instance, the example RSpec that is generated for a model class
specifies that the model class is valid. Assuming this were supposed to be
true, and it failed, I''ve now got to duplicate the code in the test in order
to find out why it
2007 Aug 30
7
mock_model in spec/lib
Has anyone else run into a problem with trying to use mock_model in spec/lib ?
For some reason, I can take the same spec, put it in spec/models, have it run
fine, but put it in spec/lib, and have it complain about not being able to find
#mock_model
Thanks,
Edward
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 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
2008 May 30
2
Any good Rails example app created with RSpec and Rspec on Rails?
Hi,
I''m pretty new to RSpec. I''ve been browsing http://opensourcerails.com
to find a good app built using RSpec (and RSpec on Rails). Does
anybody have a recommendation?
I wanna see example of mocks/stubs, associated models and integrated_view.
-T