Permalink
Browse files

Merge branch 'cedar'

  • Loading branch information...
2 parents 2d05d3a + fbb6cdb commit 0a785bbcaae362edbad09ee616ba78c6b587841c @awendt committed May 19, 2012
Showing with 56 additions and 11 deletions.
  1. +4 โˆ’0 .travis.yml
  2. +1 โˆ’0 Gemfile
  3. +15 โˆ’8 Gemfile.lock
  4. +1 โˆ’0 Procfile
  5. +1 โˆ’1 config.ru
  6. +11 โˆ’0 features/redirect.feature
  7. +7 โˆ’0 features/step_definitions/redirect_steps.rb
  8. +1 โˆ’1 features/support/env.rb
  9. +2 โˆ’0 recharge.rb
  10. +1 โˆ’1 spec/spec_helper.rb
  11. +12 โˆ’0 views/index.erb
View
@@ -1,2 +1,6 @@
+language: ruby
before_script: "sh -e /etc/init.d/xvfb start"
env: DISPLAY=:99.0
+rvm:
+ - 1.8.7
+ - 1.9.2
View
@@ -5,6 +5,7 @@ gem 'couchrest'
gem 'icalendar'
gem 'holidays'
gem 'newrelic_rpm'
+gem 'thin'
group :development do
gem 'rake'
View
@@ -23,15 +23,17 @@ GEM
term-ansicolor (>= 1.0.6)
cucumber-sinatra (0.4.0)
templater (>= 1.0.0)
+ daemons (1.1.8)
diff-lcs (1.1.3)
+ eventmachine (0.12.10)
extlib (0.9.15)
ffi (1.0.11)
gherkin (2.4.21)
json (>= 1.4.6)
highline (1.6.2)
holidays (1.0.3)
icalendar (1.1.5)
- json (1.4.6)
+ json (1.6.5)
mime-types (1.17.2)
multi_json (1.0.4)
newrelic_rpm (3.3.0)
@@ -46,14 +48,14 @@ GEM
rake (0.9.2)
rest-client (1.6.1)
mime-types (>= 1.16)
- rspec (2.6.0)
- rspec-core (~> 2.6.0)
- rspec-expectations (~> 2.6.0)
- rspec-mocks (~> 2.6.0)
- rspec-core (2.6.4)
- rspec-expectations (2.6.0)
+ rspec (2.8.0)
+ rspec-core (~> 2.8.0)
+ rspec-expectations (~> 2.8.0)
+ rspec-mocks (~> 2.8.0)
+ rspec-core (2.8.0)
+ rspec-expectations (2.8.0)
diff-lcs (~> 1.1.2)
- rspec-mocks (2.6.0)
+ rspec-mocks (2.8.0)
rubyzip (0.9.6.1)
selenium-webdriver (2.19.0)
childprocess (>= 0.2.5)
@@ -69,6 +71,10 @@ GEM
extlib (>= 0.9.5)
highline (>= 1.4.0)
term-ansicolor (1.0.6)
+ thin (1.3.1)
+ daemons (>= 1.0.9)
+ eventmachine (>= 0.12.6)
+ rack (>= 1.0.0)
tilt (1.3.3)
webrat (0.7.2)
nokogiri (>= 1.2.0)
@@ -93,4 +99,5 @@ DEPENDENCIES
rake
rspec
sinatra
+ thin
webrat
View
@@ -0,0 +1 @@
+web: bundle exec thin start -p $PORT -e $RACK_ENV
View
@@ -3,5 +3,5 @@ require 'bundler'
Bundler.require
-require 'recharge'
+require './recharge'
run Sinatra::Application
View
@@ -0,0 +1,11 @@
+@redirect
+Feature: Welcome message for redirects
+In order to be aware that I need to update my bookmarks
+As a user
+I want to be welcomed with a message
+
+@javascript
+ Scenario: Displaying a welcome message about the new URL
+ When I visit the homepage coming from the old site
+ Then I should see "Lesezeichen.*aktualisieren" in a popover
+ And I should be able to bookmark the site without any URL clutter
@@ -0,0 +1,7 @@
+When /^I visit the homepage coming from the old site$/ do
+ visit '/#moved'
+end
+
+Then /^I should be able to bookmark the site without any URL clutter$/ do
+ page.evaluate_script('window.location.hash').should be_empty
+end
View
@@ -9,7 +9,7 @@
require 'rspec'
Capybara.app = Sinatra::Application
-Capybara.default_wait_time = 5
+Capybara.default_wait_time = 8
class RechargeWorld
include Capybara::DSL
View
@@ -1,3 +1,4 @@
+# encoding: UTF-8
require 'rubygems'
require 'bundler/setup'
require 'sinatra'
@@ -27,6 +28,7 @@
end
enable :sessions
+set :session_secret, ENV['SESSION_KEY']
set :views, './views'
set :public_folder, File.dirname(__FILE__) + '/public'
View
@@ -3,7 +3,7 @@
Bundler.require(:default, :test)
-require 'recharge'
+require File.expand_path('../../recharge', __FILE__)
set :environment, :test
View
@@ -24,6 +24,18 @@
.popover('show');
}
+ if (window.location.hash === '#moved') {
+ window.location.hash = "";
+ history.pushState('', document.title, window.location.pathname);
+ $(".page-header")
+ .attr("rel", "popover")
+ .attr("title", "Wir sind umgezogen")
+ .attr("data-content", "Dein Urlaubskalender hat eine neue Heimat bei recharge.wendtswelt.de gefunden."
+ + " Bitte denk dran, deine Lesezeichen zu aktualisieren.")
+ .popover({trigger: 'manual', placement: 'below', offset: -60})
+ .popover('show');
+ }
+
$("body").click(function() {
$("[rel=popover]").each(function() { $(this).popover('hide') });
});

0 comments on commit 0a785bb

Please sign in to comment.