- bin/rake spec
- Make a directory to hold these particular specs:
- mkdir -p spec/features/todo_lists
- The -p will make any subdirectories that aren't there
- Integration test: tests the whole behavior of our application
Test that creating todo_lists works:
ouch spec/features/todo_lists/create_spec.rb
require 'spec_helper' describe "Creating todo lists" do it "redirects to the todo list index page on success" do visit "/todo_lists" click_link "New Todo list" expect(page).to have_content("New todo_list") fill_in "Title", with: "My todo list" fill_in "Description", with: "This is what I'm doing today" click_button "Create Todo list" expect(page).to have_content("My todo list") end end
validates :title, presence: true
Alejo likes this.