Adds imageable to legislation proposals

This commit is contained in:
decabeza
2018-10-01 16:48:46 +02:00
parent 1fbb428004
commit 7c194f6042
3 changed files with 21 additions and 0 deletions

View File

@@ -2,6 +2,8 @@ require 'rails_helper'
feature 'Legislation Proposals' do
let(:user) { create(:user) }
let(:process) { create(:legislation_process) }
let(:proposal) { create(:legislation_proposal) }
context "Concerns" do
@@ -16,4 +18,21 @@ feature 'Legislation Proposals' do
end
end
scenario "Create a legislation proposal with an image", :js do
create(:legislation_proposal, process: process)
login_as user
visit new_legislation_process_proposal_path(process)
fill_in 'Proposal title', with: 'Legislation proposal with image'
fill_in 'Proposal summary', with: 'Including an image on a legislation proposal'
imageable_attach_new_file(create(:image), Rails.root.join('spec/fixtures/files/clippy.jpg'))
check 'legislation_proposal_terms_of_service'
click_button 'Create proposal'
expect(page).to have_content 'Legislation proposal with image'
expect(page).to have_content 'Including an image on a legislation proposal'
expect(page).to have_css("img[alt='#{Legislation::Proposal.last.image.title}']")
end
end