Skip to content
Permalink
Browse files

Add code for Episode 05, Capybara Basics

This adds the config, feature specs, and actual app code for the
episode.
  • Loading branch information...
brettchalupa committed Nov 13, 2017
1 parent 8ac663f commit 6618d193b708536216b22d920b547b01d6468b60
@@ -0,0 +1,4 @@
class AboutController < ApplicationController
def index
end
end
@@ -0,0 +1,4 @@
class HomeController < ApplicationController
def index
end
end
@@ -0,0 +1 @@
<h1>About</h1>
@@ -0,0 +1,3 @@
<h1>Game Tracker</h1>

<%= link_to('About', about_path) %>
@@ -1,4 +1,6 @@
Rails.application.routes.draw do
get('home' => 'home#index')
get('about' => 'about#index')
get('status' => 'status#index')
get('consoles' => 'consoles#index')
end
@@ -0,0 +1,11 @@
require 'rails_helper'

RSpec.describe 'Home features' do
it 'displays the name of the app and links to the About page' do
visit('/home')
expect(page).to have_content('Game Tracker')
click_link('About')
expect(current_path).to eql('/about')
expect(page).to have_content('About')
end
end
@@ -5,6 +5,7 @@
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.env.production?
require 'rspec/rails'
require 'capybara/rspec'

# Add additional requires below this line. Rails is not loaded until this point!

0 comments on commit 6618d19

Please sign in to comment.
You can’t perform that action at this time.