1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/spec/requests/users/create_spec.rb

31 lines
609 B
Ruby
Raw Normal View History

2018-11-30 18:05:05 -05:00
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'POST /users' do
let(:user_attributes) { attributes_for :user }
def make_request
post '/users', params: { user: user_attributes }
end
specify do
expect { make_request }.to change(User, :count).from(0).to(1)
end
context 'after request' do
before { make_request }
specify do
expect(request).to redirect_to root_url
end
specify do
expect(User.last).to have_attributes user_attributes.merge(
password: nil,
password_confirmation: nil,
)
end
end
end