I fell a bit ridiculous but I really have no idea what this error is trying to tell me? I'm new to rspec and this is a new one for me. I'll post my code for clarity - ERROR: undefined method `permit' for "1":String|
CONTROLLER:
def subscriber_params
params.require(:subscriber).permit(:first_name, :last_name, :email, :phone_number)
end
SPEC: require "rails_helper"
describe SubscribersController do
include Devise::TestHelpers
let(:user) { FactoryGirl.create(:user) }
let(:subscriber) { FactoryGirl.create(:subscriber) }
it "creates a new comment" do
sign_in(user)
comment = FactoryGirl.attributes_for(:comment)
expect { post :create, subscriber: subscriber, comment: comment }.to change(Comment, :count).by(1)
end
end
ERROR:
