OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/spec/models/permitted_params_spec.rb

32 lines
1.1 KiB

require File.expand_path('../../spec_helper', __FILE__)
describe PermittedParams do
let(:user) { FactoryGirl.build(:user) }
describe :cost_entry do
it "should return comments" do
params = ActionController::Parameters.new(:cost_entry => { "comments" => "blubs" } )
PermittedParams.new(params, user).cost_entry.should == { "comments" => "blubs" }
end
it "should return units" do
params = ActionController::Parameters.new(:cost_entry => { "units" => "5.0" } )
PermittedParams.new(params, user).cost_entry.should == { "units" => "5.0" }
end
it "should return overridden_costs" do
params = ActionController::Parameters.new(:cost_entry => { "overridden_costs" => "5.0" } )
PermittedParams.new(params, user).cost_entry.should == { "overridden_costs" => "5.0" }
end
it "should return spent_on" do
params = ActionController::Parameters.new(:cost_entry => { "spent_on" => Date.today.to_s } )
PermittedParams.new(params, user).cost_entry.should == { "spent_on" => Date.today.to_s }
end
end
end