Merge pull request #4 from AyuntamientoMadrid/capybara-4
Capybara configuration
This commit is contained in:
1
Gemfile
1
Gemfile
@@ -44,5 +44,6 @@ group :development, :test do
|
||||
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
|
||||
gem 'spring'
|
||||
gem 'rspec-rails', '~> 3.0'
|
||||
gem 'capybara'
|
||||
end
|
||||
|
||||
|
||||
@@ -42,6 +42,12 @@ GEM
|
||||
builder (3.2.2)
|
||||
byebug (5.0.0)
|
||||
columnize (= 0.9.0)
|
||||
capybara (2.4.4)
|
||||
mime-types (>= 1.16)
|
||||
nokogiri (>= 1.3.3)
|
||||
rack (>= 1.0.0)
|
||||
rack-test (>= 0.5.4)
|
||||
xpath (~> 2.0)
|
||||
coffee-rails (4.1.0)
|
||||
coffee-script (>= 2.2.0)
|
||||
railties (>= 4.0.0, < 5.0)
|
||||
@@ -157,12 +163,15 @@ GEM
|
||||
binding_of_caller (>= 0.7.2)
|
||||
railties (>= 4.0)
|
||||
sprockets-rails (>= 2.0, < 4.0)
|
||||
xpath (2.0.0)
|
||||
nokogiri (~> 1.3)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
byebug
|
||||
capybara
|
||||
coffee-rails (~> 4.1.0)
|
||||
foundation-rails
|
||||
jbuilder (~> 2.0)
|
||||
|
||||
6
app/controllers/welcome_controller.rb
Normal file
6
app/controllers/welcome_controller.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class WelcomeController < ApplicationController
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
end
|
||||
1
app/views/welcome/index.html.erb
Normal file
1
app/views/welcome/index.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
<h1>Bienvenido al Ayuntamiento de Madrid</h1>
|
||||
@@ -3,7 +3,7 @@ Rails.application.routes.draw do
|
||||
# See how all your routes lay out with "rake routes".
|
||||
|
||||
# You can have the root of your site routed with "root"
|
||||
# root 'welcome#index'
|
||||
root 'welcome#index'
|
||||
|
||||
# Example of regular route:
|
||||
# get 'products/:id' => 'catalog#view'
|
||||
|
||||
10
spec/features/home_spec.rb
Normal file
10
spec/features/home_spec.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
require 'rails_helper'
|
||||
|
||||
feature "Home" do
|
||||
|
||||
scenario "Welcome message" do
|
||||
visit '/'
|
||||
expect(page).to have_content 'Bienvenido al Ayuntamiento de Madrid'
|
||||
end
|
||||
|
||||
end
|
||||
@@ -4,6 +4,8 @@ abort("The Rails environment is running in production mode!") if Rails.env.produ
|
||||
|
||||
require 'spec_helper'
|
||||
require 'rspec/rails'
|
||||
require 'capybara/rails'
|
||||
require 'capybara/rspec'
|
||||
ActiveRecord::Migration.maintain_test_schema!
|
||||
|
||||
RSpec.configure do |config|
|
||||
|
||||
Reference in New Issue
Block a user