Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Some updates

  • Loading branch information...
commit 89bc232688cc02b35917db66bf393b9b1a60d5e1 1 parent 7322429
Dimitar Haralanov authored
5 .travis.yml
... ... @@ -0,0 +1,5 @@
  1 +language: ruby
  2 +rvm:
  3 + - 1.9.3
  4 +# uncomment this line if your project needs to run something other than `rake`:
  5 +# script: bundle exec rspec spec
2  config/environments/development.rb
@@ -27,5 +27,5 @@
27 27 config.assets.compress = false
28 28
29 29 # Expands the lines which load the assets
30   - config.assets.debug = true
  30 + config.assets.debug = false
31 31 end
1  features/create_movie.feature
@@ -4,6 +4,7 @@ Feature: Create movie
4 4 As a site administrator
5 5 I want to create a movie in a specific genre
6 6
  7 + @javascript
7 8 Scenario: Create movie in genre
8 9 Given a genre named Comedy
9 10 When I create a movie Caddyshack in the Comedy genre
1  features/step_definitions/create_movie_steps.rb
@@ -3,6 +3,7 @@
3 3 end
4 4
5 5 When /^I create a movie Caddyshack in the Comedy genre$/ do
  6 + set_speed(:slow)
6 7 visit movies_path
7 8 click_link "Add Movie"
8 9 fill_in "Title", :with => "Caddyshack"
25 features/support/throttle.rb
... ... @@ -0,0 +1,25 @@
  1 +require 'selenium-webdriver'
  2 +
  3 +module ::Selenium::WebDriver::Firefox
  4 + class Bridge
  5 + attr_accessor :speed
  6 +
  7 + def execute(*args)
  8 + result = raw_execute(*args)['value']
  9 + case speed
  10 + when :slow
  11 + sleep 0.3
  12 + when :medium
  13 + sleep 0.1
  14 + end
  15 + result
  16 + end
  17 + end
  18 +end
  19 +
  20 +def set_speed(speed)
  21 + begin
  22 + page.driver.browser.send(:bridge).speed=speed
  23 + rescue
  24 + end
  25 +end

0 comments on commit 89bc232

Please sign in to comment.
Something went wrong with that request. Please try again.