Commit dbef0f9a authored by surma Lodur's avatar surma Lodur
Browse files

fix für Quest#sole soll quest Beziehung im Earning aufbauen

parent 72b08768
...@@ -12,6 +12,7 @@ class Quest < ActiveRecord::Base ...@@ -12,6 +12,7 @@ class Quest < ActiveRecord::Base
hacker.earnings.create({ hacker.earnings.create({
:user => user, :user => user,
:points => self.points, :points => self.points,
:quest => self,
:chronicle_text => self.title :chronicle_text => self.title
}) })
end # #solve end # #solve
......
...@@ -14,9 +14,10 @@ describe Quest do ...@@ -14,9 +14,10 @@ describe Quest do
describe '#solve' do describe '#solve' do
it 'should produce a reward' do it 'should produce a reward' do
hacker.reload.should have(0).earnings hacker.should have(0).earnings
subject.solve(hacker) subject.solve(hacker)
hacker.reload.should have(1).earnings hacker.reload.should have(1).earnings
hacker.earnings.first.quest.should be_eql(subject)
end end
it 'should produce text into reward' it 'should produce text into reward'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment