add feature test for proposals friendly urls

This commit is contained in:
Julian Herrero
2016-03-02 16:02:42 +01:00
parent c44745e0b4
commit c2d05d4555

View File

@@ -64,6 +64,28 @@ feature 'Proposals' do
end end
end end
context "Show" do
scenario 'When path matches the friendly url' do
proposal = create(:proposal)
right_path = proposal_path(proposal)
visit right_path
expect(current_path).to eq(right_path)
end
scenario 'When path does not match the friendly url' do
proposal = create(:proposal)
right_path = proposal_path(proposal)
old_path = "#{proposals_path}/#{proposal.id}-something-else"
visit old_path
expect(current_path).to_not eq(old_path)
expect(current_path).to eq(right_path)
end
end
scenario 'Social Media Cards' do scenario 'Social Media Cards' do
proposal = create(:proposal) proposal = create(:proposal)