Skip to content

Instantly share code, notes, and snippets.

@flarnie
Last active August 29, 2015 13:57
Show Gist options
  • Save flarnie/9857100 to your computer and use it in GitHub Desktop.
Save flarnie/9857100 to your computer and use it in GitHub Desktop.
A demo feature spec that will run on the ToDoVMC:Backbone.js Demo if capybara and selenium are correctly set up.
require 'spec_helper'
describe "ToDoMVC:Backbone.js" do
# the following is a demo spec for demonstration purposes
# it is meant to run on the ToDoMVC:Backbone.js Demo app:
# http://todomvc.com/architecture-examples/backbone/
it "allows creation of a todo-list item", :js => true do
visit "http://todomvc.com/architecture-examples/backbone/"
fill_in "new-todo", with: "TODOITEM Hello World\n"
expect(page).to have_content "TODOITEM Hello World"
expect(page).to have_content "1 item left"
end
it "allows marking todo-list item as completed", :js => true do
visit "http://todomvc.com/architecture-examples/backbone/"
find(:css, 'input.toggle').click
expect(page).to have_content "0 items left"
end
it "allows deleting todo-list items", :js => true do
visit "http://todomvc.com/architecture-examples/backbone/"
find(:css, 'button.destroy').click
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment