docbrown/spec/requests/articles/video_player_show_spec.rb
Anna Buianova 7d053471f8
Rubocop fixes in spec/requests (#18946)
* Rubocop fixes in spec/requests

* Fixed spec/requests/api/v0/articles_spec.rb

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-01-12 19:10:16 +03:00

37 lines
1.1 KiB
Ruby

require "rails_helper"
RSpec.describe "VideoPlayerShow" do
let(:user) { create(:user) }
let(:video_article) { create(:article, user: user) }
describe "GET /:slug (video articles)" do
before do
video_article.update_columns(video: "video", video_source_url: "video", title: "A Video")
get video_article.path
end
it "returns a 200 status when navigating to the video article's page" do
expect(response).to have_http_status(:ok)
end
it "renders the proper title" do
expect(response.body).to include CGI.escapeHTML(video_article.title)
end
it "renders the proper description" do
expect(response.body).to include CGI.escapeHTML(video_article.description)
end
it "renders the proper video url" do
expect(response.body).to include CGI.escapeHTML(video_article.video_source_url)
end
it "renders the proper published at date" do
expect(response.body).to include CGI.escapeHTML(video_article.readable_publish_date)
end
it "renders the proper author" do
expect(response.body).to include CGI.escapeHTML(video_article.cached_user_username)
end
end
end