Re: [rspec-users] Simple Association Redirect on delete

2011-02-28 Thread Charley
I am not sure if I am properly using the respond to call as you suggested. Here is what I tried: it "redirects to the bugs parent project" do Bug.stub(:find) { mock_bug } mock_bug.should respond_to :project_id delete :destroy, :id => "1" response.should redirect_to(project_path(:id => mock_

Re: [rspec-users] RSpec doesn't see the DATA constant

2011-02-28 Thread Matt Wynne
On 25 Feb 2011, at 00:26, Shamaoke wrote: > Thanks for the explanations, Costi G. I didn't thought that the `DATA` > constant isn't seen by the interpreter if it is in the required file. > > The only solution that I can think of right now is the following: Why not just File.read(DATA_FILE) and

Re: [rspec-users] Simple Association Redirect on delete

2011-02-28 Thread Craig Demyanovich
On Sun, Feb 27, 2011 at 10:57 PM, Charley wrote: ... > it "redirects to the bugs list" do > Bug.stub(:find) { mock_bug } > delete :destroy, :id => "1" > response.should redirect_to(bugs_url) > end > > This fails for obvious reasons. A bug belongs to a project so the > redirect should go to the

[rspec-users] Simple Association Redirect on delete

2011-02-28 Thread Charley
So am fairly new to rspec and am trying to get the hang of it, but have run into a few issues I cant figure out. Several times in my code I have model that belongs to a parent, when the model is deleted, instead of redirecting to the index action, it redirects to the show action for its parent mode