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
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
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).
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
>> 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):
>>
>>
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
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:
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
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