Re: [rspec-users] Rspec with ActionMailer and .deliver

2011-08-03 Thread Chris Mear
On 27 July 2011 18:09, Todd Sedano wrote: > I have a controller that sends out an email through a mailer. > Rails 2 > code: CurriculumCommentMailer.deliver_comment_update(@curriculum_comment, > "created") > Rails 3 code: CurriculumCommentMailer.comment_update(@curriculum_comment, > "created").del

Re: [rspec-users] Rspec teting API.

2011-08-03 Thread Sidu Ponnappa
Your controller specs should suffice for API specs. Is there anything specific you want to do beyond assert the response code, content type and some basic assertions against the body of the response? You may want to take a look at http://github.com/c42/rspec-http for asserting against response co

[rspec-users] How to test modules and custom validators

2011-08-03 Thread Piter Fcbk
I'm trying to have most of the important stuff tested and in order to do that I run in front of some stuff I'm not quite sure which is the best way to test them. At this time I am having question around how to test modules and the custom validators (the typical email format validator for example).

[rspec-users] Rspec teting API.

2011-08-03 Thread Kleber Correia
Hi! Guys, I wanna test an API built in Rails 3.0.3. So, my question is... What's the better way to test my own api? I guess that a requests specs like these: describe 'POST /client' it 'works' do assert_difference post '/clients', :client => {...} end end can be appropriate... Someone jus

Re: [rspec-users] A bit confused with the use of assign() to test views

2011-08-03 Thread David Chelimsky
>> Keep in mind that rspec-rails is a thin wrapper around the built-in Rails >> testing framework. The convention of relating a symbol in the spec to an >> instance variable in the view was established by Rails with the `assigns` >> method in functional tests (controller specs in rspec): >> >>

Re: [rspec-users] A bit confused with the use of assign() to test views

2011-08-03 Thread Gordon Yeong
Hello David Thanks for that. Doesn't assign have 2 arguments with the first being the variable to be assigned to and the second being the contents? On Aug 3, 2011 7:01 PM, "ct9a" wrote: > also, i have just read a little more in the rspec book. > > here's an extract: > > - extract star

Re: [rspec-users] A bit confused with the use of assign() to test views

2011-08-03 Thread David Chelimsky
On Aug 3, 2011, at 3:50 AM, ct9a wrote: > also, i have just read a little more in the rspec book. > > here's an extract: > > - extract start - > assign() > View specs expose an assign method, which we use to provide data to > the view. Modify the spec as follows:

Re: [rspec-users] A bit confused with the use of assign() to test views

2011-08-03 Thread ct9a
also, i have just read a little more in the rspec book. here's an extract: - extract start - assign() View specs expose an assign method, which we use to provide data to the view. Modify the spec as follows: describe "messages/show.html.erb" do it "displays the

[rspec-users] A bit confused with the use of assign() to test views

2011-08-03 Thread ct9a
hi guys, I'm trying to pick up Rspec to port an existing application in rails 2.3.8 to rails 3. I'm using the pragmatic "The Rspec book" (dec 2010) as a reference. read around the book and the rspec docs. 1) assign method - syntax: assign( , - what it means to me: run the codes in the b