permits fields in management investment creation
This commit is contained in:
@@ -52,7 +52,7 @@ class Management::Budgets::InvestmentsController < Management::BaseController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def investment_params
|
def investment_params
|
||||||
params.require(:budget_investment).permit(:title, :description, :external_url, :heading_id)
|
params.require(:budget_investment).permit(:title, :description, :external_url, :heading_id, :tag_list, :organization_name, :location)
|
||||||
end
|
end
|
||||||
|
|
||||||
def only_verified_users
|
def only_verified_users
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ feature 'Budget Investments' do
|
|||||||
expect(current_path).to eq(new_budget_investment_path(budget_id: budget.id))
|
expect(current_path).to eq(new_budget_investment_path(budget_id: budget.id))
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Create notice' do
|
scenario 'Create' do
|
||||||
login_as(author)
|
login_as(author)
|
||||||
|
|
||||||
visit new_budget_investment_path(budget_id: budget.id)
|
visit new_budget_investment_path(budget_id: budget.id)
|
||||||
@@ -220,15 +220,20 @@ feature 'Budget Investments' do
|
|||||||
fill_in 'budget_investment_title', with: 'Build a skyscraper'
|
fill_in 'budget_investment_title', with: 'Build a skyscraper'
|
||||||
fill_in 'budget_investment_description', with: 'I want to live in a high tower over the clouds'
|
fill_in 'budget_investment_description', with: 'I want to live in a high tower over the clouds'
|
||||||
fill_in 'budget_investment_external_url', with: 'http://http://skyscraperpage.com/'
|
fill_in 'budget_investment_external_url', with: 'http://http://skyscraperpage.com/'
|
||||||
|
fill_in 'budget_investment_location', with: 'City center'
|
||||||
check 'budget_investment_terms_of_service'
|
check 'budget_investment_terms_of_service'
|
||||||
|
|
||||||
click_button 'Create Investment'
|
click_button 'Create Investment'
|
||||||
|
|
||||||
expect(page).to have_content 'Investment created successfully'
|
expect(page).to have_content 'Investment created successfully'
|
||||||
|
expect(page).to have_content 'Build a skyscraper'
|
||||||
|
expect(page).to have_content 'I want to live in a high tower over the clouds'
|
||||||
|
expect(page).to have_content 'http://http://skyscraperpage.com/'
|
||||||
|
expect(page).to have_content 'City center'
|
||||||
|
|
||||||
visit user_url(author, filter: :budget_investments)
|
visit user_url(author, filter: :budget_investments)
|
||||||
expect(page).to have_content "1 Investment"
|
expect(page).to have_content '1 Investment'
|
||||||
expect(page).to have_content "Build a skyscraper"
|
expect(page).to have_content 'Build a skyscraper'
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Errors on create' do
|
scenario 'Errors on create' do
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ feature 'Budget Investments' do
|
|||||||
|
|
||||||
background do
|
background do
|
||||||
login_as_manager
|
login_as_manager
|
||||||
@budget = create(:budget, phase: 'selecting', name: "2016")
|
@budget = create(:budget, phase: 'selecting', name: "2033")
|
||||||
@group = create(:budget_group, budget: @budget, name: 'Whole city')
|
@group = create(:budget_group, budget: @budget, name: 'Whole city')
|
||||||
@heading = create(:budget_heading, group: @group, name: "Health")
|
@heading = create(:budget_heading, group: @group, name: "Health")
|
||||||
end
|
end
|
||||||
@@ -33,18 +33,18 @@ feature 'Budget Investments' do
|
|||||||
fill_in 'budget_investment_title', with: 'Build a park in my neighborhood'
|
fill_in 'budget_investment_title', with: 'Build a park in my neighborhood'
|
||||||
fill_in 'budget_investment_description', with: 'There is no parks here...'
|
fill_in 'budget_investment_description', with: 'There is no parks here...'
|
||||||
fill_in 'budget_investment_external_url', with: 'http://moarparks.com'
|
fill_in 'budget_investment_external_url', with: 'http://moarparks.com'
|
||||||
|
fill_in 'budget_investment_location', with: 'City center'
|
||||||
check 'budget_investment_terms_of_service'
|
check 'budget_investment_terms_of_service'
|
||||||
|
|
||||||
click_button 'Create Investment'
|
click_button 'Create Investment'
|
||||||
|
|
||||||
expect(page).to have_content 'Investment created successfully.'
|
expect(page).to have_content 'Investment created successfully.'
|
||||||
|
|
||||||
expect(page).to have_content '2017'
|
|
||||||
#expect(page).to have_content 'Whole city'
|
|
||||||
expect(page).to have_content 'Health'
|
expect(page).to have_content 'Health'
|
||||||
expect(page).to have_content 'Build a park in my neighborhood'
|
expect(page).to have_content 'Build a park in my neighborhood'
|
||||||
expect(page).to have_content 'There is no parks here...'
|
expect(page).to have_content 'There is no parks here...'
|
||||||
expect(page).to have_content 'http://moarparks.com'
|
expect(page).to have_content 'http://moarparks.com'
|
||||||
|
expect(page).to have_content 'City center'
|
||||||
expect(page).to have_content user.name
|
expect(page).to have_content user.name
|
||||||
expect(page).to have_content I18n.l(@budget.created_at.to_date)
|
expect(page).to have_content I18n.l(@budget.created_at.to_date)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user