diff --git a/spec/factories/papers.rb b/spec/factories/papers.rb index 32bd0d7..6da21c2 100644 --- a/spec/factories/papers.rb +++ b/spec/factories/papers.rb @@ -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 \ No newline at end of file diff --git a/spec/features/paper/index_paper_spec.rb b/spec/features/paper/index_paper_spec.rb new file mode 100644 index 0000000..04eb939 --- /dev/null +++ b/spec/features/paper/index_paper_spec.rb @@ -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