Initial commit

This commit is contained in:
Senad Uka
2020-05-31 22:38:19 +02:00
commit 858fafc3c5
1280 changed files with 65918 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
require "rails_helper"
describe Videos::ReportPublicationsController do
let(:admin) { create(:user, :admin) }
let(:project) { create(:project, account: admin.accounts.first) }
before do
sign_in(admin)
end
describe "#create" do
it "sets the video report publication date" do
video = create(:video, report_published_at: nil, project: project)
post :create, params: { video_id: video }
expect(video.reload).to be_report_published
end
end
describe "#destroy" do
it "unsets the video report publication date" do
video = create(:video, report_published_at: Time.zone.now, project: project)
delete :destroy, params: { video_id: video }
expect(video.reload).not_to be_report_published
end
end
end