Skip to content

Instantly share code, notes, and snippets.

@seventhsense
Created March 16, 2013 07:48
Show Gist options
  • Save seventhsense/5175433 to your computer and use it in GitHub Desktop.
Save seventhsense/5175433 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe "todos/new" do
before(:each) do
assign(:todo, stub_model(Todo,
:title => "MyString",
:done => false
).as_new_record)
end
it "renders new todo form" do
render
# Run the generator again with the --webrat flag if you want to use webrat matchers
assert_select "form[action=?][method=?]", todos_path, "post" do
assert_select "input#todo_title[name=?]", "todo[title]"
assert_select "input#todo_done[name=?]", "todo[done]"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment