Skip to content

Commit

Permalink
specs for home page
Browse files Browse the repository at this point in the history
  • Loading branch information
Renata Marques authored and Renata Marques committed Dec 7, 2019
1 parent 3b513dc commit 69451b2
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 2 deletions.
30 changes: 30 additions & 0 deletions spec/features/pages/pages_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
require "rails_helper"

RSpec.describe 'home page', type: :feature do
describe 'texts in home page' do

before { visit root_path }

context 'match texts in home page' do
it 'expect correct title' do
expect(page).to have_content('Projeto Carambolo!')
end

it 'expect correct description' do
expect(page).to have_content('Um projeto pela vida')
end

it 'expect correct section about' do
expect(page).to have_content('Sobre')
end

it 'expect correct section projects' do
expect(page).to have_content('Projetos')
end

it 'expect correct article' do
expect(page).to have_content('Artigo sobre a técnica das três colunas')
end
end
end
end
2 changes: 1 addition & 1 deletion spec/requests/entries_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

RSpec.describe "Entries", type: :request do
describe "GET /entries" do
it "works! (now write some real specs)" do
it "works!" do
get entries_path
expect(response).to have_http_status(200)
end
Expand Down
10 changes: 10 additions & 0 deletions spec/requests/pages_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'rails_helper'

RSpec.describe 'home page', type: :request do
describe "GET /root" do
it "works!" do
get root_path
expect(response).to have_http_status(200)
end
end
end
2 changes: 1 addition & 1 deletion spec/requests/users_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

RSpec.describe "Users", type: :request do
describe "GET /users" do
it "works! (now write some real specs)" do
it "works!" do
get users_path
expect(response).to have_http_status(200)
end
Expand Down
9 changes: 9 additions & 0 deletions spec/routing/pages_routing_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require "rails_helper"

RSpec.describe PagesController, type: :routing do
describe "routing" do
it "routes to #home" do
expect(:get => "/").to route_to("pages#home")
end
end
end

0 comments on commit 69451b2

Please sign in to comment.