tack2us/spec/features/creates_new_paste_spec.rb

23 lines
536 B
Ruby
Raw Normal View History

2014-02-14 15:54:22 -05:00
require 'spec_helper'
feature 'Creates new paste' do
2014-02-14 16:40:15 -05:00
let(:paste) { FactoryGirl.create(:paste) }
let(:blank_content) { " " }
before { visit new_paste_path }
subject { page }
2014-02-14 15:54:22 -05:00
scenario 'with valid content' do
2014-02-14 16:40:15 -05:00
fill_in 'Content', with: paste.content
2014-02-14 15:54:22 -05:00
click_button 'Paste it!'
2014-02-14 16:40:15 -05:00
should have_content('Your paste has been added')
2014-02-14 15:54:22 -05:00
end
scenario 'with blank content' do
2014-02-14 16:40:15 -05:00
fill_in 'Content', with: blank_content
2014-02-14 15:54:22 -05:00
click_button 'Paste it!'
2014-02-14 16:40:15 -05:00
should have_content('There was an error submitting your form')
2014-02-14 15:54:22 -05:00
end
end