[rspec-users] Testing Plugins + Lib Code

2008-03-03 Thread Mark Dodwell
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

[rspec-users] View Specs vs. Stories

2008-05-23 Thread Mark Dodwell
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

Re: [rspec-users] View Specs vs. Stories

2008-05-23 Thread Mark Dodwell
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.

Re: [rspec-users] View Specs vs. Stories

2008-05-23 Thread Mark Dodwell
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

[rspec-users] Mocking Models in Controller Specs...

2008-05-26 Thread Mark Dodwell
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)

Re: [rspec-users] Mocking Models in Controller Specs...

2008-05-27 Thread Mark Dodwell
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

Re: [rspec-users] Mocking Models in Controller Specs...

2008-05-27 Thread Mark Dodwell
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

[rspec-users] Full Trace for Stories

2008-06-08 Thread Mark Dodwell
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

Re: [rspec-users] Full Trace for Stories

2008-06-08 Thread Mark Dodwell
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

[rspec-users] RSpec in Rails -- HTTP methods

2008-09-10 Thread Mark Dodwell
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

Re: [rspec-users] RSpec in Rails -- HTTP methods

2008-09-12 Thread Mark Dodwell
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