fixes typos and spec for budgets investments

This commit is contained in:
Alberto Garcia Cabeza
2017-01-08 22:17:14 +01:00
parent 64366ba1f6
commit 8722699cd8
7 changed files with 16 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
module BudgetsHelper
def budget_phases_select_options
Budget::PHASES.map { |ph| [ t("budget.phase.#{ph}"), ph ] }
Budget::PHASES.map { |ph| [ t("budgets.phase.#{ph}"), ph ] }
end
def budget_currency_symbol_select_options

View File

@@ -76,7 +76,7 @@ class Budget < ActiveRecord::Base
end
def translated_phase
I18n.t "budget.phase.#{phase}"
I18n.t "budgets.phase.#{phase}"
end
def formatted_amount(amount)

View File

@@ -25,7 +25,7 @@
<%= budget.name %>
</td>
<td class="small">
<%= t("budget.phase.#{budget.phase}") %>
<%= t("budgets.phase.#{budget.phase}") %>
</td>
<td class="small">
<%= link_to t("admin.budgets.index.budget_investments"), admin_budget_budget_investments_path(budget_id: budget.id) %>

View File

@@ -14,24 +14,24 @@
<p>
<strong><%= t('budgets.show.phase') %></strong>
<br>
<%= t("budget.phase.#{@budget.phase}") %>
<%= t("budgets.phase.#{@budget.phase}") %>
</p>
<% if can?(:create, Budget::Investment.new(budget: @budget))%>
<% if current_user %>
<% 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 %>
<div class="callout warning margin-top">
<%= t("budget.investments.index.sidebar.verified_only",
verify: link_to(t("budget.investments.index.sidebar.verify_account"), verification_path)).html_safe %>
<%= t("budgets.investments.index.sidebar.verified_only",
verify: link_to(t("budgets.investments.index.sidebar.verify_account"), verification_path)).html_safe %>
</div>
<% end %>
<% else %>
<div class="callout primary margin-top">
<%= t("budget.investments.index.sidebar.not_logged_in",
sign_in: link_to(t("budget.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 %>
<%= t("budgets.investments.index.sidebar.not_logged_in",
sign_in: link_to(t("budgets.investments.index.sidebar.sign_in"), new_user_session_path),
sign_up: link_to(t("budgets.investments.index.sidebar.sign_up"), new_user_registration_path)).html_safe %>
</div>
<% end %>
<% end %>

View File

@@ -18,7 +18,7 @@
<%= budget.name %>
</td>
<td>
<%= t("budget.phase.#{budget.phase}") %>
<%= t("budgets.phase.#{budget.phase}") %>
</td>
<td>
<%= @investments_with_valuation_open[budget.id] %>

View File

@@ -23,7 +23,7 @@ feature 'Admin budgets' do
visit admin_budgets_path
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
scenario 'Filters by phase' do

View File

@@ -148,7 +148,7 @@ feature 'Budget Investments' do
fill_in 'budget_investment_description', with: 'This is the description'
check 'budget_investment_terms_of_service'
click_button 'Create'
click_button 'Create Investment'
expect(page.status_code).to eq(200)
expect(page.html).to be_empty
@@ -166,7 +166,7 @@ feature 'Budget Investments' do
fill_in 'budget_investment_description', with: 'This is the description'
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(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/'
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 'You can access it from My activity'
@@ -201,7 +201,7 @@ feature 'Budget Investments' do
login_as(author)
visit new_budget_investment_path(budget_id: budget.id)
click_button 'Create'
click_button 'Create Investment'
expect(page).to have_content error_message
end