changes the responsible_name from username to document_number

This commit is contained in:
kikito
2016-04-08 17:45:20 +02:00
parent 9a74b79eab
commit 61b2c087b6
2 changed files with 4 additions and 4 deletions

View File

@@ -123,7 +123,7 @@ class SpendingProposal < ActiveRecord::Base
end
def set_responsible_name
self.responsible_name = author.try(:username)
self.responsible_name = author.try(:document_number)
end
end

View File

@@ -262,10 +262,10 @@ describe SpendingProposal do
end
describe "responsible_name" do
it "gets updated with the user name" do
u = create(:user, username: "manolo")
it "gets updated with the document_number" do
u = create(:user, document_number: "123456")
sp = create(:spending_proposal, author: u)
expect(sp.responsible_name).to eq("manolo")
expect(sp.responsible_name).to eq("123456")
end
end