Merge pull request #52 from finnlabs/feature/fix-rspec

Feature/fix rspec
pull/6827/head
sschu 11 years ago
commit 955d4b30b0
  1. 1
      config/locales/de.yml
  2. 1
      config/locales/en.yml
  3. 24
      spec/controllers/costlog_controller_spec.rb

@ -4,6 +4,7 @@ de:
attributes:
cost_entry:
issue: "Ticket"
work_package: "Ticket"
overridden_costs: "Überschriebene Kosten"
spent: "Gebucht"
spent_on: "Datum"

@ -4,6 +4,7 @@ en:
attributes:
cost_entry:
issue: "Issue"
work_package: "Issue"
overridden_costs: "Overridden costs"
spent: "Spent"
spent_on: "Date"

@ -2,12 +2,12 @@ require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb")
describe CostlogController do
include Cost::PluginSpecHelper
let (:project) { FactoryGirl.build(:project_with_trackers) }
let (:issue) { FactoryGirl.build(:issue, :project => project,
let (:project) { FactoryGirl.create(:project_with_trackers) }
let (:issue) { FactoryGirl.create(:issue, :project => project,
:author => user,
:tracker => project.trackers.first) }
let (:user) { FactoryGirl.build(:user) }
let (:user2) { FactoryGirl.build(:user) }
let (:user) { FactoryGirl.create(:user) }
let (:user2) { FactoryGirl.create(:user) }
let (:controller) { FactoryGirl.build(:role, :permissions => [:log_costs, :edit_cost_entries]) }
let (:cost_type) { FactoryGirl.build(:cost_type) }
let (:cost_entry) { FactoryGirl.build(:cost_entry, :work_package => issue,
@ -44,22 +44,14 @@ describe CostlogController do
end
before do
# removing db entries added by fixtures
# TODO: remove fixtures
CostType.destroy_all
CostEntry.destroy_all
Project.destroy_all
User.destroy_all
Rate.destroy_all
user.save!
project.save!
#issue_status
issue.save! if issue
disable_flash_sweep
@controller.stub!(:check_if_login_required)
end
after do
User.current = nil
end
describe "GET new" do
let(:params) { { "work_package_id" => issue.id.to_s } }

Loading…
Cancel
Save