fixtures • DatabaseCleaner RAZ de la base entre chaque test • RSpec Test framework for code • Capybara Test framework for web apps • Selenium Web browser automadon Ou2ls
{ create(:admin_user, roles: ['message_manager']) } let!(:site) { create(:site, account: user.account) } context "with at least one site with a live version" do before do login_as(user.login) visit "/applications" end it "should view a list of applications" do page.should have_content("Your applications") end it "should see the application name" do page.should have_content(site.name) end end end Tests -‐ RSpec & FactoryGirl FactoryGirl.define do factory :site do sequence(:name) {|i| "SiteName#{i}"} account end end