Skip to content

Commit

Permalink
Closing issue #6
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Burgess committed Nov 24, 2015
1 parent 0f11ba6 commit 7e665e2
Showing 1 changed file with 48 additions and 48 deletions.
96 changes: 48 additions & 48 deletions spec/sinatra_views_lab_spec.rb
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
describe App do

describe 'GET /hello' do
before do
get '/hello'
end

it 'sends a 200 status code' do
expect(last_response.status).to eq(200)
end

it 'renders a template called "hello.erb" ' do
expect(last_response.body).to eq(File.read("views/hello.erb"))
end
end

describe 'GET /goodbye' do
before do
get '/goodbye'
end

it 'sends a 200 status code' do
expect(last_response.status).to eq(200)
end

it 'renders a template called "goodbye.erb" ' do
expect(last_response.body).to include("Goodbye Joe")
end
end
describe 'GET /date' do
before do
get '/date'
end

it 'sends a 200 status code' do
expect(last_response.status).to eq(200)
end

it 'renders a template called "date.erb" ' do
expect(last_response.body).to include("The date is")
end

it 'includes the current date and time' do
if last_response.status == 200
expect(last_response.body).to include(Date.today.strftime("%A, %B %d, %Y"))
elsif last_response.status = 404
fail "Your application is not responding to GET /date. Did you create that route?"
end
end
end
describe 'GET /hello' do
before do
get '/hello'
end

it 'sends a 200 status code' do
expect(last_response.status).to eq(200)
end

it 'renders a template called "hello.erb" ' do
expect(last_response.body).to eq(File.read("views/hello.erb"))
end
end

describe 'GET /goodbye' do
before do
get '/goodbye'
end

it 'sends a 200 status code' do
expect(last_response.status).to eq(200)
end

it 'renders a template called "goodbye.erb" ' do
expect(last_response.body).to include("Goodbye Joe")
end
end
describe 'GET /date' do
before do
get '/date'
end

it 'sends a 200 status code' do
expect(last_response.status).to eq(200)
end

it 'renders a template called "date.erb" ' do
expect(last_response.body).to include("The date is")
end

it 'includes the current date and time' do
if last_response.status == 200
expect(last_response.body).to include(Date.today.strftime("%A, %B %d, %Y"))
elsif last_response.status = 404
fail "Your application is not responding to GET /date. Did you create that route?"
end
end
end
end

0 comments on commit 7e665e2

Please sign in to comment.