Skip to content

Commit 3f2a2fd

Browse files
committed
Fix admin logout feature spec
Update the admin logout feature spec to accommodate the UI changes in the admin navigation bar. The 'Logout' link is now nested within a 'details' tag and must be clicked/expanded to access the logout functionality.
1 parent 6bcc8d1 commit 3f2a2fd

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

spec/features/admin/sign_out_spec.rb

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,28 @@
1515
end
1616

1717
scenario 'allows a signed in user to logout' do
18-
click_link 'Logout'
18+
click_logout_link
1919
visit spree.admin_login_path
2020
expect(page).to have_text 'Login'
2121
expect(page).not_to have_text 'Logout'
2222
end
23+
24+
def click_logout_link
25+
new_version? ? logout_new_version : logout_old_version
26+
end
27+
28+
def new_version?
29+
Gem::Requirement.new('>= 4.2').satisfied_by?(Spree.solidus_gem_version)
30+
end
31+
32+
def logout_new_version
33+
find('details div', text: user.email, wait: 10).click
34+
within('details') do
35+
click_link 'Logout'
36+
end
37+
end
38+
39+
def logout_old_version
40+
click_link 'Logout'
41+
end
2342
end

0 commit comments

Comments
 (0)