Hi,
I'm quite new to Rspec and I'm embarking on a new project. One thing I'm
really not sure about is how to test plugins and code in your 'lib/'
folder. Where would these specs actually live in the dir structure?
Should you test plugins by creating specs within the plugin's dir? Or by
adding a s
Do RSpec stories make view specs redundant? Does anybody spec their
views *and* use stories, and if so how?
Any views (no pun intended) appreciated.
~ Thanks
Mark
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyf
Mark Dodwell wrote:
> Do RSpec stories make view specs redundant?
Sorry I should clarify that I'm talking about Rails view specs
specifically here.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.
Thanks for the comments.
This might be more obvious, but what about rails integration tests --
presumably RSpec stories make these redundant for sure?
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
htt
I find myself doing this kind of thing a lot in Controller Specs:
@vacancy = mock_model(Vacancy)
@vacancy.stub!(:reference)
@vacancy.stub!(:title)
@vacancy.stub!(:created_at)
@vacancy.stub!(:updated_at)
@vacancy.stub!(:body)
@vacancy.stub!(:contract)
Many thanks for your replies.
David Chelimsky wrote:
> Use stub_model instead (if you're using source from github - if not
> the 1.4 release is coming soon).
Thanks - that helps a great deal.
Scott Taylor wrote:
> I would highly suggest using :null_object => true in view specs (or
> controller
Also, any opinions on using a Factory pattern for instantiating mocks of
models? I like the idea of maintaining mocks in one place as I
frequently use them across several specs for models that have
associations. Do you think it would create dependency issues between the
specs using that Factory
Does anybody know how to get full backtraces for stories when they fail?
I tried 'ruby stories/all.rb --trace' but it doesn't like that option.
Thanks,
~ Mark
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge
Ben Mabey wrote:
> Mark,
> Try 'ruby stories/all.rb --backtrace'.
Thanks, that worked.
I think the test actually failed due to a bug in a gem I'm using
(webrat). Without the -backtrace switch RSpec quietens the backtrace by
stopping once it hits a gem it seems. Presumable that's intended?
~ M
It seems that RSpec-Rails isn't restricted to the HTTP methods
correctly.
For example doing:
http://foo.local/session/destroy
in the browser doesn't work, because the destroy action is only
recognised with the HTTP 'delete' verb.
But in Rspec specs if you do:
get :destroy
It works.
Is t
Many thanks for the info, that certainly clarifies things!
~ Mark
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
11 matches
Mail list logo