debian-mirror-gitlab/spec/controllers/profiles/keys_controller_spec.rb

24 lines
490 B
Ruby
Raw Normal View History

2019-07-31 22:56:46 +05:30
# frozen_string_literal: true
2014-09-02 18:07:02 +05:30
require 'spec_helper'
2020-06-23 00:09:42 +05:30
RSpec.describe Profiles::KeysController do
2016-06-02 11:05:42 +05:30
let(:user) { create(:user) }
2020-04-08 14:13:33 +05:30
describe 'POST #create' do
before do
sign_in(user)
end
it 'creates a new key' do
expires_at = 3.days.from_now
expect do
post :create, params: { key: build(:key, expires_at: expires_at).attributes }
end.to change { Key.count }.by(1)
expect(Key.last.expires_at).to be_like_time(expires_at)
end
end
2014-09-02 18:07:02 +05:30
end