Tuesday, December 17, 2013

Rails Tutorial 3.3

Rspec  Should vs. Expect

https://www.relishapp.com/rspec/rspec-expectations/v/2-0/docs/matchers/expect-change
http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
http://betterspecs.org/

In Rspec have_title is a method which checks for an HTML title within the given content

I always forget what .erb stands for. It is embedded Ruby.

Rails method
provide
<% provide(:title, 'Home') %>
<%= yield(:title) %>
The distinction between the two types of embedded Ruby is that <% ... %> executes the code inside, while <%= ... %> executes it and inserts the result into the template.

No comments:

Post a Comment