Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/views/profiles/keys')
-rw-r--r--spec/views/profiles/keys/_form.html.haml_spec.rb4
-rw-r--r--spec/views/profiles/keys/_key.html.haml_spec.rb8
2 files changed, 2 insertions, 10 deletions
diff --git a/spec/views/profiles/keys/_form.html.haml_spec.rb b/spec/views/profiles/keys/_form.html.haml_spec.rb
index ba8394178d9..c807512a11a 100644
--- a/spec/views/profiles/keys/_form.html.haml_spec.rb
+++ b/spec/views/profiles/keys/_form.html.haml_spec.rb
@@ -15,8 +15,6 @@ RSpec.describe 'profiles/keys/_form.html.haml' do
context 'when the form partial is used' do
before do
- allow(view).to receive(:ssh_key_expires_field_description).and_return('Key can still be used after expiration.')
-
render
end
@@ -37,7 +35,7 @@ RSpec.describe 'profiles/keys/_form.html.haml' do
it 'has the expires at field', :aggregate_failures do
expect(rendered).to have_field('Expiration date', type: 'date')
expect(page.find_field('Expiration date')['min']).to eq(l(1.day.from_now, format: "%Y-%m-%d"))
- expect(rendered).to have_text('Key can still be used after expiration.')
+ expect(rendered).to have_text('Key becomes invalid on this date')
end
it 'has the validation warning', :aggregate_failures do
diff --git a/spec/views/profiles/keys/_key.html.haml_spec.rb b/spec/views/profiles/keys/_key.html.haml_spec.rb
index ed8026d2453..1040541332d 100644
--- a/spec/views/profiles/keys/_key.html.haml_spec.rb
+++ b/spec/views/profiles/keys/_key.html.haml_spec.rb
@@ -59,11 +59,7 @@ RSpec.describe 'profiles/keys/_key.html.haml' do
end
context 'when the key has expired' do
- let_it_be(:key) do
- create(:personal_key,
- user: user,
- expires_at: 2.days.ago)
- end
+ let_it_be(:key) { create(:personal_key, :expired, user: user) }
it 'renders "Expired:" as the expiration date label' do
render
@@ -91,8 +87,6 @@ RSpec.describe 'profiles/keys/_key.html.haml' do
where(:valid, :expiry, :result) do
false | 2.days.from_now | 'Key type is forbidden. Must be DSA, ECDSA, ED25519, ECDSA_SK, or ED25519_SK'
- false | 2.days.ago | 'Key type is forbidden. Must be DSA, ECDSA, ED25519, ECDSA_SK, or ED25519_SK'
- true | 2.days.ago | 'Key usable beyond expiration date.'
true | 2.days.from_now | ''
end