[Rails] Re: Rspec - In views
Rails ROR wrote:
> Hi All,
>
> I want to test my application with rspec.
>
> In order to test my views, I have written few specs as given in the
> examples.
>
> Is there any way to test the user acceptance?
>
> i.e suppose the field takes a string.
>
> I want to test it for integers, float values, alphanumeric values, etc
> and
> run tests against that.
These sound like unit tests for the model to me. As mentioned views are
dumb (unless you're talking about client-side JavaScript validation).
What you really care about is whether invalid data can make it through
your model validation.
> I need to get the tests failed as it takes only string.
>
> I would be really thankful if someone can guide me on this.
The kinds of things you want to test in your view specs is whether the
text field gets rendered, that it's the right kind of control, has the
right style class or id applied to it, that it has the right label, etc.
If you want to create specs for user acceptance then integration specs
are the place to do that. As also mentioned; Cucumber provides a great
way to provide those integration specs. Cucumber makes the acceptance
test easy for the stakeholder to read and understand, which is vital to
good user acceptance scripts.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home