Skip to content

Commit

Permalink
Added capybara and rspec
Browse files Browse the repository at this point in the history
  • Loading branch information
emachnic committed May 13, 2014
1 parent 63c677b commit 4ebf625
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Gemfile
Expand Up @@ -14,6 +14,10 @@ gem "wdm", "~> 0.1.0", :platforms => [:mswin, :mingw]
gem "tzinfo-data", platforms: [:mswin, :mingw]

gem 'haml'
gem 'gh_contributors'
gem 'rake', '~> 10.3'
group :development, :test do
gem 'gh_contributors'
gem 'rake', '~> 10.3'
gem 'rspec'
gem 'capybara'
end

23 changes: 23 additions & 0 deletions Gemfile.lock
Expand Up @@ -7,6 +7,12 @@ GEM
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
capybara (2.2.1)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
chunky_png (1.3.1)
coffee-script (2.2.0)
coffee-script-source
Expand All @@ -18,6 +24,7 @@ GEM
sass (~> 3.2.19)
compass-import-once (1.0.4)
sass (>= 3.2, < 3.5)
diff-lcs (1.2.5)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
Expand Down Expand Up @@ -73,8 +80,12 @@ GEM
sprockets (~> 2.2)
sprockets-helpers (~> 1.1.0)
sprockets-sass (~> 1.1.0)
mime-types (2.2)
mini_portile (0.5.2)
minitest (4.7.5)
multi_json (1.10.0)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
padrino-helpers (0.12.1)
i18n (~> 0.6, >= 0.6.7)
padrino-support (= 0.12.1)
Expand All @@ -92,6 +103,14 @@ GEM
ffi (>= 0.5.0)
rb-kqueue (0.2.2)
ffi (>= 0.5.0)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.8)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.6)
sass (3.2.19)
sprockets (2.12.1)
hike (~> 1.2)
Expand All @@ -111,15 +130,19 @@ GEM
uglifier (2.5.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
xpath (2.0.0)
nokogiri (~> 1.3)

PLATFORMS
ruby

DEPENDENCIES
capybara
gh_contributors
haml
middleman (~> 3.3.2)
middleman-livereload (~> 3.1.0)
rake (~> 10.3)
rspec
tzinfo-data
wdm (~> 0.1.0)
54 changes: 54 additions & 0 deletions spec/features/index_spec.rb
@@ -0,0 +1,54 @@
# -*- coding: utf-8 -*-
require 'spec_helper'

describe 'Index page', type: :feature do
context 'with English locale' do
before do
visit '/en'
end

it 'should have an English tagline' do
expect(page).to have_content 'Get to work'
end
end

context 'with Czech locale' do
before do
visit '/cs'
end

it 'should have a Czech tagline' do
expect(page).to have_content 'Dej se do práce'
end
end

context 'with French locale' do
before do
visit '/fr-FR'
end

it 'should have a French tagline' do
expect(page).to have_content 'Au travail'
end
end

context 'with Brazilian Portugese locale' do
before do
visit '/pt-BR'
end

it 'should have a Brazilian Portugese tagline' do
expect(page).to have_content 'Ao trabalho'
end
end

context 'with Russian locale' do
before do
visit '/ru-RU'
end

it 'should have a Russian tagline' do
expect(page).to have_content 'За работу'
end
end
end
9 changes: 9 additions & 0 deletions spec/spec_helper.rb
@@ -0,0 +1,9 @@
require 'middleman'
require 'rspec'
require 'capybara/rspec'

Capybara.app = Middleman::Application.server.inst do
set :root, File.expand_path(File.join(File.dirname(__FILE__), '..'))
set :environment, :development
set :show_exceptions, false
end

0 comments on commit 4ebf625

Please sign in to comment.