While unit testing tests each element separately, functional tests are
aiming
at testing system as a whole. I.e. unit testing do not check how
elements work
together.

Moreover, over the course of project code changes. So, new bugs are
introduced, too.
Things which seem impossible at the moment ('we always have these
elements in our views')
after code changes are not so impossible anymore ;) This is especially
true when new
coder joins the team and do not know previous assumptions.

On Jan 16, 10:19 pm, "Agis A." <corestudios...@gmail.com> wrote:
> Hola!
>
> I'm new to Rails (it's my 2nd day reading the *Agile development with Rails
> *book) and I'm kinda confused with the tests.
>
> So let me get this straight: With* unit* testing, we see if our model is
> working as it should (as our app's specifications demands) and Rails
> provides us with all the unit testing features just to make our lifes
> easier, so we don't have to manually enter values to see if they're
> accepted or not.  Is that right? And we're doing these tests to save
> ourself from future work for fixing bugs in our code etc. With unit testing
> we can pre-emptively fix our code's possible bugs, right from the beggining.
>
> Unit testing seems clear, but Functional testing is a little confusing to
> me: Why are we doing this? Where does it helps us? I know that we're
> testing for example if there are certain elements in our rendered views,
> for example:  assert_select '#columns #side a', minimum: 4 but how could we
> *not* have these elements in our views? Why are these kinds of test useful
> and not just extra-code to write? To me it seems more like a
> security-measure (checking if certain links appear on a page) more than a
> test to see if something is wrong. However, judging from the file names,
> functional testing is about the controller, right?
>
> Thanks in advance :)

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to