about summary refs log tree commit diff
path: root/spec/features
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2023-04-14 19:22:47 -0500
committerStarfall <us@starfall.systems>2023-04-14 19:22:47 -0500
commit4fe1689de43f4404eb9530fcfbcbfb26d6c1c13a (patch)
tree6811b845bb7f4966b10dcefa3dea404246f161c7 /spec/features
parent65c1e53a32cabcdbb7bca57002bb0f6acdebe07e (diff)
parentbed63f6dae0879ac840066b031229e0d139089cd (diff)
Merge remote-tracking branch 'glitch/main' HEAD main
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/log_in_spec.rb28
-rw-r--r--spec/features/profile_spec.rb18
2 files changed, 23 insertions, 23 deletions
diff --git a/spec/features/log_in_spec.rb b/spec/features/log_in_spec.rb
index de1a6de03..934575ea6 100644
--- a/spec/features/log_in_spec.rb
+++ b/spec/features/log_in_spec.rb
@@ -2,45 +2,45 @@
 
 require 'rails_helper'
 
-feature 'Log in' do
+describe 'Log in' do
   include ProfileStories
 
-  given(:email)        { "test@example.com" }
-  given(:password)     { "password" }
-  given(:confirmed_at) { Time.zone.now }
+  subject { page }
+
+  let(:email)        { 'test@example.com' }
+  let(:password)     { 'password' }
+  let(:confirmed_at) { Time.zone.now }
 
-  background do
+  before do
     as_a_registered_user
     visit new_user_session_path
   end
 
-  subject { page }
-
-  scenario 'A valid email and password user is able to log in' do
+  it 'A valid email and password user is able to log in' do
     fill_in 'user_email', with: email
     fill_in 'user_password', with: password
     click_on I18n.t('auth.login')
 
-    is_expected.to have_css('div.app-holder')
+    expect(subject).to have_css('div.app-holder')
   end
 
-  scenario 'A invalid email and password user is not able to log in' do
+  it 'A invalid email and password user is not able to log in' do
     fill_in 'user_email', with: 'invalid_email'
     fill_in 'user_password', with: 'invalid_password'
     click_on I18n.t('auth.login')
 
-    is_expected.to have_css('.flash-message', text: failure_message('invalid'))
+    expect(subject).to have_css('.flash-message', text: failure_message('invalid'))
   end
 
   context do
-    given(:confirmed_at) { nil }
+    let(:confirmed_at) { nil }
 
-    scenario 'A unconfirmed user is able to log in' do
+    it 'A unconfirmed user is able to log in' do
       fill_in 'user_email', with: email
       fill_in 'user_password', with: password
       click_on I18n.t('auth.login')
 
-      is_expected.to have_css('div.admin-wrapper')
+      expect(subject).to have_css('div.admin-wrapper')
     end
   end
 
diff --git a/spec/features/profile_spec.rb b/spec/features/profile_spec.rb
index ec4f9a53f..421b68a16 100644
--- a/spec/features/profile_spec.rb
+++ b/spec/features/profile_spec.rb
@@ -2,25 +2,25 @@
 
 require 'rails_helper'
 
-feature 'Profile' do
+describe 'Profile' do
   include ProfileStories
 
-  given(:local_domain) { ENV['LOCAL_DOMAIN'] }
+  subject { page }
+
+  let(:local_domain) { ENV['LOCAL_DOMAIN'] }
 
-  background do
+  before do
     as_a_logged_in_user
     with_alice_as_local_user
   end
 
-  subject { page }
-
-  scenario 'I can view Annes public account' do
+  it 'I can view Annes public account' do
     visit account_path('alice')
 
-    is_expected.to have_title("alice (@alice@#{local_domain})")
+    expect(subject).to have_title("alice (@alice@#{local_domain})")
   end
 
-  scenario 'I can change my account' do
+  it 'I can change my account' do
     visit settings_profile_path
 
     fill_in 'Display name', with: 'Bob'
@@ -28,6 +28,6 @@ feature 'Profile' do
 
     first('button[type=submit]').click
 
-    is_expected.to have_content 'Changes successfully saved!'
+    expect(subject).to have_content 'Changes successfully saved!'
   end
 end