Move *_url spec to controller, because the subscription model does not handle urls anymore

This commit is contained in:
Maximilian Grundke
2017-10-16 14:02:40 +02:00
parent 686d56bbd6
commit a00adbce25
2 changed files with 21 additions and 15 deletions

View File

@ -16,21 +16,6 @@ describe Submission do
expect(described_class.create.errors[:user_type]).to be_present
end
[:render, :run, :test].each do |action|
describe "##{action}_url" do
let(:url) { submission.send(:"#{action}_url") }
it "starts like the #{action} path" do
filename = File.basename(__FILE__)
expect(url).to start_with(Rails.application.routes.url_helpers.send(:"#{action}_submission_path", submission, filename).sub(filename, ''))
end
it 'ends with a placeholder' do
expect(url).to end_with(Submission::FILENAME_URL_PLACEHOLDER)
end
end
end
describe '#main_file' do
let(:submission) { FactoryGirl.create(:submission) }