testing publishing in controller
This commit is contained in:
parent
90e7238554
commit
130558e2be
@ -113,5 +113,23 @@ describe CampaignsController do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "allows sending to better video successfully" do
|
||||||
|
camp = FactoryGirl.create(:campaign)
|
||||||
|
c = Campaign.find(camp.id)
|
||||||
|
patch :update, listingcode: c.listingcode, campaign: c.attributes, send: true
|
||||||
|
c_published = Campaign.find(camp.id)
|
||||||
|
expect(response.status).to eq 302
|
||||||
|
expect(c_published.sent).to eq(true)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
it "allows sending to better video and shows errors" do
|
||||||
|
camp = FactoryGirl.create(:campaign)
|
||||||
|
camp.listingcode = "videolistingmissing"
|
||||||
|
camp.save
|
||||||
|
c = Campaign.find(camp.id)
|
||||||
|
patch :update, listingcode: c.listingcode, campaign: c.attributes, send: true
|
||||||
|
expect(response.status).to eq 200 # no redirect, show error on page.
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user