Skip to content

Instantly share code, notes, and snippets.

@pzel
Created September 29, 2011 06:43
Show Gist options
  • Save pzel/1250123 to your computer and use it in GitHub Desktop.
Save pzel/1250123 to your computer and use it in GitHub Desktop.
Capybara-webkit version (from 1056023)
# coding: utf-8
ENV['RACK_ENV'] = 'test'
require './nejiro'
require 'rspec'
require 'capybara'
require 'capybara/rspec'
require 'capybara-webkit'
RSpec.configure do |config|
config.before(:each) {DataMapper.auto_migrate!}
config.include Capybara
end
Capybara.javascript_driver = :webkit
Capybara.default_driver = :webkit
Capybara.app = Sinatra::Application.new
describe "Tag page" do
it "should check for ununsed tags upon hovering" do
visit "/tags"
fill_in "tag[content]", :with => "hyperbole"
click_button "Add tag"
tag = page.find('div.info_for_tag')
tag.trigger(:mouseover)
page.should have_selector("div.unused_tag")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment