require 'rails_helper'

describe "New author page", type: :feature do
  
 it "should render withour error" do
    visit new_author_path
 end
 it "should have text input for first name, last name and homepage" do
 	visit new_author_path

 	expect(page).to have_field('First name')
 	expect(page).to have_field('Last name')
 	expect(page).to have_field('Homepage')
 end
 it "should hava a submit button" do
 	visit new_author_path

 	expect(page).to have_css('input[type="submit"]')
 end

 it "should not be possbile to create an author without a last name" do
 	visit new_author_path
 	click_button 'submit'

 	expect(page).to have_content("Last name can't be blank")
 end
end
