fixes typos and spec for budgets investments
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
module BudgetsHelper
|
module BudgetsHelper
|
||||||
|
|
||||||
def budget_phases_select_options
|
def budget_phases_select_options
|
||||||
Budget::PHASES.map { |ph| [ t("budget.phase.#{ph}"), ph ] }
|
Budget::PHASES.map { |ph| [ t("budgets.phase.#{ph}"), ph ] }
|
||||||
end
|
end
|
||||||
|
|
||||||
def budget_currency_symbol_select_options
|
def budget_currency_symbol_select_options
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class Budget < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def translated_phase
|
def translated_phase
|
||||||
I18n.t "budget.phase.#{phase}"
|
I18n.t "budgets.phase.#{phase}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def formatted_amount(amount)
|
def formatted_amount(amount)
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<%= budget.name %>
|
<%= budget.name %>
|
||||||
</td>
|
</td>
|
||||||
<td class="small">
|
<td class="small">
|
||||||
<%= t("budget.phase.#{budget.phase}") %>
|
<%= t("budgets.phase.#{budget.phase}") %>
|
||||||
</td>
|
</td>
|
||||||
<td class="small">
|
<td class="small">
|
||||||
<%= link_to t("admin.budgets.index.budget_investments"), admin_budget_budget_investments_path(budget_id: budget.id) %>
|
<%= link_to t("admin.budgets.index.budget_investments"), admin_budget_budget_investments_path(budget_id: budget.id) %>
|
||||||
|
|||||||
@@ -14,24 +14,24 @@
|
|||||||
<p>
|
<p>
|
||||||
<strong><%= t('budgets.show.phase') %></strong>
|
<strong><%= t('budgets.show.phase') %></strong>
|
||||||
<br>
|
<br>
|
||||||
<%= t("budget.phase.#{@budget.phase}") %>
|
<%= t("budgets.phase.#{@budget.phase}") %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<% if can?(:create, Budget::Investment.new(budget: @budget))%>
|
<% if can?(:create, Budget::Investment.new(budget: @budget))%>
|
||||||
<% if current_user %>
|
<% if current_user %>
|
||||||
<% if current_user.level_two_or_three_verified? %>
|
<% if current_user.level_two_or_three_verified? %>
|
||||||
<%= link_to t("budget.investments.index.sidebar.create"), new_budget_investment_path(@budget), class: "button margin-top expanded" %>
|
<%= link_to t("budgets.investments.index.sidebar.create"), new_budget_investment_path(@budget), class: "button margin-top expanded" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="callout warning margin-top">
|
<div class="callout warning margin-top">
|
||||||
<%= t("budget.investments.index.sidebar.verified_only",
|
<%= t("budgets.investments.index.sidebar.verified_only",
|
||||||
verify: link_to(t("budget.investments.index.sidebar.verify_account"), verification_path)).html_safe %>
|
verify: link_to(t("budgets.investments.index.sidebar.verify_account"), verification_path)).html_safe %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="callout primary margin-top">
|
<div class="callout primary margin-top">
|
||||||
<%= t("budget.investments.index.sidebar.not_logged_in",
|
<%= t("budgets.investments.index.sidebar.not_logged_in",
|
||||||
sign_in: link_to(t("budget.investments.index.sidebar.sign_in"), new_user_session_path),
|
sign_in: link_to(t("budgets.investments.index.sidebar.sign_in"), new_user_session_path),
|
||||||
sign_up: link_to(t("budget.investments.index.sidebar.sign_up"), new_user_registration_path)).html_safe %>
|
sign_up: link_to(t("budgets.investments.index.sidebar.sign_up"), new_user_registration_path)).html_safe %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<%= budget.name %>
|
<%= budget.name %>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<%= t("budget.phase.#{budget.phase}") %>
|
<%= t("budgets.phase.#{budget.phase}") %>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<%= @investments_with_valuation_open[budget.id] %>
|
<%= @investments_with_valuation_open[budget.id] %>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ feature 'Admin budgets' do
|
|||||||
visit admin_budgets_path
|
visit admin_budgets_path
|
||||||
|
|
||||||
expect(page).to have_content(budget.name)
|
expect(page).to have_content(budget.name)
|
||||||
expect(page).to have_content(I18n.t("budget.phase.#{budget.phase}"))
|
expect(page).to have_content(I18n.t("budgets.phase.#{budget.phase}"))
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Filters by phase' do
|
scenario 'Filters by phase' do
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ feature 'Budget Investments' do
|
|||||||
fill_in 'budget_investment_description', with: 'This is the description'
|
fill_in 'budget_investment_description', with: 'This is the description'
|
||||||
check 'budget_investment_terms_of_service'
|
check 'budget_investment_terms_of_service'
|
||||||
|
|
||||||
click_button 'Create'
|
click_button 'Create Investment'
|
||||||
|
|
||||||
expect(page.status_code).to eq(200)
|
expect(page.status_code).to eq(200)
|
||||||
expect(page.html).to be_empty
|
expect(page.html).to be_empty
|
||||||
@@ -166,7 +166,7 @@ feature 'Budget Investments' do
|
|||||||
fill_in 'budget_investment_description', with: 'This is the description'
|
fill_in 'budget_investment_description', with: 'This is the description'
|
||||||
check 'budget_investment_terms_of_service'
|
check 'budget_investment_terms_of_service'
|
||||||
|
|
||||||
click_button 'Create'
|
click_button 'Create Investment'
|
||||||
|
|
||||||
expect(page).to have_content 'Sorry, that was too quick! Please resubmit'
|
expect(page).to have_content 'Sorry, that was too quick! Please resubmit'
|
||||||
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))
|
||||||
@@ -183,7 +183,7 @@ feature 'Budget Investments' do
|
|||||||
fill_in 'budget_investment_external_url', with: 'http://http://skyscraperpage.com/'
|
fill_in 'budget_investment_external_url', with: 'http://http://skyscraperpage.com/'
|
||||||
check 'budget_investment_terms_of_service'
|
check 'budget_investment_terms_of_service'
|
||||||
|
|
||||||
click_button 'Create'
|
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 'You can access it from My activity'
|
expect(page).to have_content 'You can access it from My activity'
|
||||||
@@ -201,7 +201,7 @@ feature 'Budget Investments' 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)
|
||||||
click_button 'Create'
|
click_button 'Create Investment'
|
||||||
expect(page).to have_content error_message
|
expect(page).to have_content error_message
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user