Skip to content

Commit

Permalink
wip - home page specs
Browse files Browse the repository at this point in the history
  • Loading branch information
renatamarques97 authored and Renata Marques committed Dec 19, 2019
1 parent 09294f7 commit 811c365
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/features/users/sign_in_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
describe "the signin process", type: :feature do
before :each do
User.create!(email: '[email protected]', password: 'password')
end

it "signs me in" do
visit '/users/sign_in'
within("#session") do
fill_in 'Email', with: '[email protected]'
fill_in 'Password', with: 'password'
end
click_button 'Log in'
expect(page).to have_content 'Success'
end
end
10 changes: 10 additions & 0 deletions spec/requests/home_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'rails_helper'

RSpec.describe "Home", type: :request do
describe "GET /home" do
it "works! (now write some real specs)" do
get root_path
expect(response).to have_http_status(200)
end
end
end
17 changes: 17 additions & 0 deletions spec/views/pages/home.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require 'rails_helper'

RSpec.describe "home", type: :view do
before do
render
end

context "renders attributes in <p>" do
it "expect correct text" do
expect(rendered).to match(/Sobre/)
end

# it "expect correct text" do
# expect(rendered).to match(/MyText/)
# end
end
end

0 comments on commit 811c365

Please sign in to comment.