Move *_url spec to controller, because the subscription model does not handle urls anymore
This commit is contained in:
@ -183,6 +183,27 @@ describe SubmissionsController do
|
||||
expect_template(:show)
|
||||
end
|
||||
|
||||
describe 'GET #show.json' do
|
||||
before(:each) { get :show, id: submission.id, format: :json }
|
||||
expect_assigns(submission: :submission)
|
||||
expect_status(200)
|
||||
|
||||
[:render, :run, :test].each do |action|
|
||||
describe "##{action}_url" do
|
||||
let(:url) { response.body.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
|
||||
end
|
||||
|
||||
describe 'GET #score' do
|
||||
let(:request) { proc { get :score, id: submission.id } }
|
||||
before(:each) { request.call }
|
||||
|
Reference in New Issue
Block a user