2015-03-29 18:19:18 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2017-04-11 09:59:21 +00:00
|
|
|
describe "oEmbed provider" do
|
2015-03-29 18:19:18 +00:00
|
|
|
|
|
|
|
let(:asciicast) { create(:asciicast) }
|
|
|
|
|
|
|
|
it "responds with status 200 for JSON" do
|
2015-03-30 15:49:08 +00:00
|
|
|
get "/oembed?url=http://localhost:3000/a/#{asciicast.id}&format=json&maxwidth=500&maxheight=300"
|
2015-03-29 18:19:18 +00:00
|
|
|
expect(response.status).to eq(200)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "responds with status 200 for XML" do
|
|
|
|
get "/oembed?url=http://localhost:3000/a/#{asciicast.id}&format=xml"
|
|
|
|
expect(response.status).to eq(200)
|
|
|
|
end
|
|
|
|
|
2015-06-16 18:53:40 +00:00
|
|
|
it "responds with status 200 when only maxwidth given" do
|
|
|
|
get "/oembed?url=http://localhost:3000/a/#{asciicast.id}&format=json&maxwidth=500"
|
|
|
|
expect(response.status).to eq(200)
|
|
|
|
end
|
|
|
|
|
2015-03-29 18:19:18 +00:00
|
|
|
end
|