Merge pull request #2186 from wairbut-m2c/iagirre-add-images-to-milestones

Add Images to Milestones
This commit is contained in:
Raimond Garcia
2017-12-13 19:56:04 +01:00
committed by GitHub
11 changed files with 26 additions and 3 deletions

View File

@@ -62,11 +62,14 @@ feature 'Admin budget investment milestones' do
context "Edit" do
scenario "Change title and description" do
milestone = create(:budget_investment_milestone, investment: @investment)
create(:image, imageable: milestone)
visit admin_budget_budget_investment_path(@investment.budget, @investment)
click_link milestone.title
expect(page).to have_css("img[alt='#{milestone.image.title}']")
fill_in 'budget_investment_milestone_title', with: 'Changed title'
fill_in 'budget_investment_milestone_description', with: 'Changed description'
@@ -74,6 +77,7 @@ feature 'Admin budget investment milestones' do
expect(page).to have_content 'Changed title'
expect(page).to have_content 'Changed description'
expect(page).to have_link 'Show image'
end
end

View File

@@ -495,6 +495,7 @@ feature 'Budget Investments' do
investment = create(:budget_investment)
milestone = create(:budget_investment_milestone, investment: investment, title: "New text to show",
created_at: DateTime.new(2015, 9, 19).utc)
image = create(:image, imageable: milestone)
login_as(user)
visit budget_investment_path(budget_id: investment.budget.id, id: investment.id)
@@ -505,6 +506,7 @@ feature 'Budget Investments' do
expect(page).to have_content(milestone.title)
expect(page).to have_content(milestone.description)
expect(page).to have_content("Published 2015-09-19")
expect(page.find("#image_#{milestone.id}")['alt']).to have_content image.title
end
end