Updated

spec/requests / missing_tokens_spec.rb

C
41 lines of codes
0 methods
N/A complexity/method
3 churn
66.77 complexity
58 duplications
require 'rails_helper' RSpec.describe "missing a 'token'", type: :request, show_exceptions: true do let(:petition) { FactoryBot.create(:open_petition) } describe "when verifying the signature" do
  1. Similar code found in 2 nodes Locations: 0 1
let(:signature) { FactoryBot.create(:pending_signature, petition: petition) } before do get "/signatures/#{signature.id}/verify" end it "returns 404 Not Found" do expect(response).to have_http_status(:not_found) end end describe "when viewing the signed page" do let(:signature) { FactoryBot.create(:validated_signature, :just_signed, petition: petition) } before do get "/signatures/#{signature.id}/signed" end it "redirects to the petition page" do expect(response).to redirect_to("/petitions/#{petition.id}") end end describe "when unsubscribing" do
  1. Similar code found in 2 nodes Locations: 0 1
let(:signature) { FactoryBot.create(:validated_signature, petition: petition) } before do get "/signatures/#{signature.id}/unsubscribe" end it "returns 404 Not Found" do expect(response).to have_http_status(:not_found) end end end