configures capybara [#4]
This commit is contained in:
1
Gemfile
1
Gemfile
@@ -42,5 +42,6 @@ group :development, :test do
|
|||||||
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
|
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
|
||||||
gem 'spring'
|
gem 'spring'
|
||||||
gem 'rspec-rails', '~> 3.0'
|
gem 'rspec-rails', '~> 3.0'
|
||||||
|
gem 'capybara'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,12 @@ GEM
|
|||||||
builder (3.2.2)
|
builder (3.2.2)
|
||||||
byebug (5.0.0)
|
byebug (5.0.0)
|
||||||
columnize (= 0.9.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-rails (4.1.0)
|
||||||
coffee-script (>= 2.2.0)
|
coffee-script (>= 2.2.0)
|
||||||
railties (>= 4.0.0, < 5.0)
|
railties (>= 4.0.0, < 5.0)
|
||||||
@@ -154,12 +160,15 @@ GEM
|
|||||||
binding_of_caller (>= 0.7.2)
|
binding_of_caller (>= 0.7.2)
|
||||||
railties (>= 4.0)
|
railties (>= 4.0)
|
||||||
sprockets-rails (>= 2.0, < 4.0)
|
sprockets-rails (>= 2.0, < 4.0)
|
||||||
|
xpath (2.0.0)
|
||||||
|
nokogiri (~> 1.3)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
byebug
|
byebug
|
||||||
|
capybara
|
||||||
coffee-rails (~> 4.1.0)
|
coffee-rails (~> 4.1.0)
|
||||||
jbuilder (~> 2.0)
|
jbuilder (~> 2.0)
|
||||||
jquery-rails
|
jquery-rails
|
||||||
|
|||||||
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".
|
# See how all your routes lay out with "rake routes".
|
||||||
|
|
||||||
# You can have the root of your site routed with "root"
|
# You can have the root of your site routed with "root"
|
||||||
# root 'welcome#index'
|
root 'welcome#index'
|
||||||
|
|
||||||
# Example of regular route:
|
# Example of regular route:
|
||||||
# get 'products/:id' => 'catalog#view'
|
# 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 'spec_helper'
|
||||||
require 'rspec/rails'
|
require 'rspec/rails'
|
||||||
|
require 'capybara/rails'
|
||||||
|
require 'capybara/rspec'
|
||||||
ActiveRecord::Migration.maintain_test_schema!
|
ActiveRecord::Migration.maintain_test_schema!
|
||||||
|
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
|
|||||||
Reference in New Issue
Block a user