Skip to content

Commit

Permalink
Refs #21: Add index tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus-Brand committed Nov 3, 2017
1 parent ce102e3 commit 703b991
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/factories/papers.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FactoryGirl.define do
factory :paper do
# title "COMPUTING MACHINERY AND INTELLIGENCE"
# venue "Mind 49: 433-460"
# year 1950
title "COMPUTING MACHINERY AND INTELLIGENCE"
venue "Mind 49: 433-460"
year 1950
# authors {build_list :author, 1}
end
end
54 changes: 54 additions & 0 deletions spec/features/paper/index_paper_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
require 'rails_helper'

describe 'Paper index page', type: :feature do
it 'should render without error' do
visit papers_path
end

it 'should show_data' do
FactoryGirl.create :paper
visit papers_path

expect(page.text).to match(/COMPUTING MACHINERY AND INTELLIGENCE/i)
end

# it 'should have a link to new author' do
# FactoryGirl.create :author
# visit authors_path
#
# expect(page).to have_link('Add author')
# expect(page).to have_link('Show')
# end
#
# it 'should have a link to show author' do
# FactoryGirl.create :author
# visit authors_path
#
# expect(page).to have_link('Show')
# end
#
# it 'should have a link to edit author' do
# FactoryGirl.create :author
# visit authors_path
#
# expect(page).to have_link('Edit')
# end
#
# it 'should have a link to destroy author' do
# FactoryGirl.create :author
# visit authors_path
#
# expect(page).to have_link('Destroy')
# end
#
# it 'should actually remove the author' do
# FactoryGirl.create :author
# visit authors_path
#
# expect(Author.find_by_first_name('Alan')).not_to be_nil
#
# click_link('Destroy')
#
# expect(Author.find_by_first_name('Alan')).to be_nil
# end
end

0 comments on commit 703b991

Please sign in to comment.