VIew helpers for building views that are easily inspected via Capybara so you don't have to care about markup.
Go to file
John Bintz 7b6368be02 start readme 2012-12-08 10:00:29 -05:00
lib enable turning on/off semantic data helpers 2012-12-08 09:55:53 -05:00
.gitignore initial commit, messing around 2012-11-19 08:39:43 -05:00
Gemfile initial commit, messing around 2012-11-19 08:39:43 -05:00
LICENSE initial commit, messing around 2012-11-19 08:39:43 -05:00
README.md start readme 2012-12-08 10:00:29 -05:00
Rakefile initial commit, messing around 2012-11-19 08:39:43 -05:00
semantic_rails_view_helpers.gemspec initial commit, messing around 2012-11-19 08:39:43 -05:00

README.md

Make your Rails Capybara testing even faster and more accurate! Looking for text strings is for the birds.

Your Views

Write out attributes using attributes_for:

#object
  = attributes_for object do |f|
    %h2= f.field(:name)
    %h3= f.field(:description)

Then look for those fields using Capybara! Because you shouldn't care about the DOM, just that your field is in there:

@object = Object.create!(:name => @name, :description => @description)

visit object_path(@object)

find_attribute(:name, @object.name)
find_attribute(:description, @object.description)