fixes pending specs

This commit is contained in:
rgarcia
2016-07-27 16:39:25 +02:00
parent fa052d990e
commit f21fda0898
9 changed files with 25 additions and 15 deletions

View File

@@ -207,9 +207,7 @@ FactoryGirl.define do
end
factory :budget_group, class: 'Budget::Group' do
### TMP HACK to associate existing budget to a group
budget { Budget.first }
###
budget
sequence(:name) { |n| "Group #{n}" }
end

View File

@@ -1,13 +1,15 @@
require 'rails_helper'
xfeature 'Budget Investments' do
feature 'Budget Investments' do
let(:author) { create(:user, :level_two, username: 'Isabel') }
let(:budget) { create(:budget) }
let(:group) { create(:budget_group, budget: budget) }
scenario 'Index' do
investments = [create(:budget_investment, budget: budget), create(:budget_investment, budget: budget), create(:budget_investment, :feasible, budget: budget)]
unfeasible_investment = create(:budget_investment, :unfeasible, budget: budget)
heading = create(:budget_heading, group: group)
investments = [create(:budget_investment, heading: heading), create(:budget_investment, heading: heading), create(:budget_investment, :feasible, heading: heading)]
unfeasible_investment = create(:budget_investment, :unfeasible, heading: heading)
visit budget_investments_path(budget_id: budget.id)

View File

@@ -2,16 +2,19 @@ require 'rails_helper'
feature 'Budgets' do
xscenario 'Index' do
scenario 'Index' do
budgets = create_list(:budget, 3)
visit budgets_path
budgets.each {|budget| expect(page).to have_link(budget.name)}
end
xscenario 'Show' do
scenario 'Show' do
budget = create(:budget)
heading = create(:budget_heading, budget: budget)
group = create(:budget_group, budget: budget)
heading = create(:budget_heading, group: group)
visit budget_path(budget)
expect(page).to have_content(budget.name)
expect(page).to have_content(heading.name)
end

View File

@@ -1,6 +1,6 @@
require 'rails_helper'
xdescribe Budget::Investment do
describe Budget::Investment do
let(:investment) { build(:budget_investment) }
it "should be valid" do

View File

@@ -41,7 +41,7 @@ describe Budget do
expect(budget.heading_price(heading)).to eq(100)
end
xit "returns -1 if the heading provided is not part of the budget" do
it "returns -1 if the heading provided is not part of the budget" do
expect(budget.heading_price(create(:budget_heading))).to eq(-1)
end
end