Re: [rspec-users] Testing Controllers with respond_to?

2008-03-25 Thread Matt Berther
Hi Seth, To get around this, are you able to test the response.headers collection? This tests the code that you wrote, rather than the template logic performed by rails. response.headers['Content-Type'].should == "text/html" Untested, of course... but it may work :)

Re: [rspec-users] Trouble with my first Story

2008-03-26 Thread Matt Berther
Hi Glen, I do not mean to insult you, but is /session/create actually doing a redirect? A similar rspec test works for me. -- Matt Berther http://www.mattberther.com On Mar 26, 2008, at 5:51 PM, Glenn Ford wrote: > On Mar 26, 2008, at 6:28 PM, Chuck Remes wrote: > >> >&g

Re: [rspec-users] spec'ing models

2008-03-31 Thread Matt Berther
been doing it for a while. -- Matt Berther http://www.mattberther.com On Mar 31, 2008, at 6:21 PM, Tim Haines wrote: Hi there, A couple of complete newb questions here. Should I be spec'ing the existence of attributes on models? While reading through the docs and googling I have

Re: [rspec-users] spec'ing validates_uniqueness_of :whatever

2008-04-02 Thread Matt Berther
e_error_on(:name, :taken) end end -- Matt Berther http://www.mattberther.com On Apr 2, 2008, at 2:13 AM, Juanma Cervera wrote: > Hello > > I am learning rspec and trying to especify the activerecord > validations > of my models. > > How would I make a require_unique

Re: [rspec-users] textmate => pass, autotest => failing specs ???

2008-04-15 Thread Matt Berther
s such a discrepancy > between environments in the outcome of my tests. > > Thanks heaps! > Giuseppe > -- > Posted via http://www.ruby-forum.com/. > ___ > rspec-users mailing list > rspec-users@rubyforge.org >

[rspec-users] How much details is enough?

2008-04-17 Thread Matt Berther
nd it "should assign to the model" do get '/' assigns[:model].should == model end it "should render feed template" do get '/' response.should render_template('feeds/model_feed.xml.erb') end end Obviously, bot

Re: [rspec-users] How much details is enough?

2008-04-18 Thread Matt Berther
;/' > > response.should render_template('feeds/model_feed.xml.erb') > >end > > end > > This test would be valuable in a context where the XML feed output is > complex. In that case, testing the output directly might not > sufficiently enab

Re: [rspec-users] mock expectation in before block

2008-04-29 Thread Matt Berther
Hi Andrea, I generally put stub! calls in the before block and then have the mock expectation in the example block. -- Matt Berther http://www.mattberther.com On Apr 29, 2008, at 5:59 AM, Andrea Fazzi wrote: Hi all, consider a class Foo that send, in its constructor, some message to

Re: [rspec-users] Everyone Using Rspec Autotest?

2008-05-04 Thread Matt Berther
Hi Andrew, I've been using rspactor (the command line version) and really prefer it to autotest. If you're using a Mac, you may want to look at this. -- Matt Berther http://www.mattberther.com On May 3, 2008, at 1:36 PM, Andrew Brown wrote: I will, once I resolve the error.