Skip to content

Commit

Permalink
Refs #14: red test
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBrendel committed Nov 3, 2017
1 parent 9aa2303 commit a2b2f83
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
12 changes: 7 additions & 5 deletions spec/features/author/edit_author_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
require 'rails_helper'

describe "Edit author page", type: :feature do

it "should render withour error" do
describe 'Edit author page', type: :feature do
it 'should render without error' do
@alan = FactoryGirl.create :author
visit edit_author_path(@alan)
end

end
it 'should edit with no error' do
@alan = FactoryGirl.create :author
visit edit_author_path(@alan)
end
end
14 changes: 6 additions & 8 deletions spec/features/author/index_author_spec.rb
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
require 'rails_helper'

describe "Index author page", type: :feature do

it "should render withour error" do
describe 'Index author page', type: :feature do
it 'should render without error' do
visit authors_path
end

it "should display alan" do
it 'should display alan' do
FactoryGirl.create :author
visit authors_path

expect(page.text).to match(/alan turing/i)
expect(page.text).to match(/http:\/\/wikipedia\.de\/Alan_Turing/i)
end

it "should display a link to create new authors" do
it 'should display a link to create new authors' do
visit authors_path

expect(page).to have_link('Add author')
end

it "should display a link to show alan's details" do
it 'should display a link to show alan\'s details' do
FactoryGirl.create :author
visit authors_path

expect(page).to have_link('Show')
end

end
end
10 changes: 4 additions & 6 deletions spec/features/author/show_author_spec.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
require 'rails_helper'

describe "Show author page", type: :feature do

it "should render withour error" do
describe 'Show author page', type: :feature do
it 'should render withour error' do
@alan = FactoryGirl.create :author
visit author_path(@alan)
end

it "should display the first_name" do
it 'should display the first_name' do
@alan = FactoryGirl.create :author
visit author_path(@alan)

expect(page.text).to match(/first name: alan/i)
end

end
end

0 comments on commit a2b2f83

Please sign in to comment.