added tests

This commit is contained in:
Hauke Klement
2015-02-24 19:08:53 +01:00
parent 42c8b47d40
commit 9bcc27e129

View File

@ -33,6 +33,16 @@ describe Submission do
end end
end end
[:score, :stop].each do |action|
describe "##{action}_url" do
let(:url) { @submission.send(:"#{action}_url") }
it "corresponds to the #{action} path" do
expect(url).to eq(Rails.application.routes.url_helpers.send(:"#{action}_submission_path", @submission))
end
end
end
describe '#to_s' do describe '#to_s' do
it "equals the class' model name" do it "equals the class' model name" do
expect(@submission.to_s).to eq(described_class.model_name.human) expect(@submission.to_s).to eq(described_class.model_name.human)