Skip to content

Commit

Permalink
visit home spec
Browse files Browse the repository at this point in the history
  • Loading branch information
khaiql committed Jul 18, 2015
1 parent 5bf5ceb commit e531030
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
11 changes: 5 additions & 6 deletions apps/web/templates/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
<a class="navbar-brand" href="#">Lotus Tutorial</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<form class="navbar-form navbar-right">
<form class="navbar-form navbar-right" id='login-form'>
<div class="form-group">
<input type="text" placeholder="Email" class="form-control">
<input id='email' type="text" placeholder="Email" class="form-control">
</div>
<div class="form-group">
<input type="password" placeholder="Password" class="form-control">
<input id='password' type="password" placeholder="Password" class="form-control">
</div>
<button type="submit" class="btn btn-success">Sign in</button>
</form>
Expand All @@ -55,9 +55,8 @@
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<div class="container">
<h1>Hello, world!</h1>
<p>This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
<p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more &raquo;</a></p>
<h1>You are not signed in</h1>
<p>Please sign in to see your tweets or <a class="btn btn-primary" href="#" role="button">Sign Up</a></p>
</div>
</div>

Expand Down
27 changes: 27 additions & 0 deletions spec/web/features/visit_home_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
require 'features_helper'

describe 'Visit Home Page' do
it 'has title Lotus Tutorial' do
visit '/'
expect(page).to have_content('Lotus Tutorial')
end

context 'user has not signed in' do
before do
visit '/'
end
it 'has login form' do
expect(page).to have_selector("form#login-form")
expect(page).to have_selector('form#login-form input#email')
expect(page).to have_selector('form#login-form input#password[type=password]')
end

it 'has "Please sign in to see your tweets" sentence' do
expect(page).to have_content("Please sign in to see your tweets")
end

it 'has Sign Up button' do
expect(page).to have_link('Sign Up')
end
end
end

0 comments on commit e531030

Please sign in to comment.