Merge pull request #2922 from consul/legislation-proposals-imageable

Legislation proposals imageable
This commit is contained in:
Alberto
2018-10-02 11:22:19 +02:00
committed by GitHub
8 changed files with 60 additions and 7 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