Skip to content

Commit 5a8d695

Browse files
authored
Merge pull request #264 from solidusio/gh-actions
CI: Run tests on GH actions
2 parents aba81b2 + 9042939 commit 5a8d695

13 files changed

Lines changed: 86 additions & 75 deletions

File tree

.circleci/config.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
schedule:
9+
- cron: "0 0 * * 4" # every Thursday
10+
11+
concurrency:
12+
group: test-${{ github.ref_name }}
13+
cancel-in-progress: ${{ github.ref_name != 'main' }}
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
rspec:
20+
name: Solidus ${{ matrix.solidus-branch }}, Rails ${{ matrix.rails-version }} and Ruby ${{ matrix.ruby-version }} on ${{ matrix.database }}
21+
runs-on: ubuntu-24.04
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
rails-version:
26+
- "7.2"
27+
- "8.0"
28+
ruby-version:
29+
- "3.1"
30+
- "3.4"
31+
solidus-branch:
32+
- "v4.4"
33+
- "v4.5"
34+
- "v4.6"
35+
database:
36+
- "postgresql"
37+
- "mysql"
38+
- "sqlite"
39+
exclude:
40+
- solidus-branch: "v4.5"
41+
ruby-version: "3.1"
42+
- solidus-branch: "v4.6"
43+
ruby-version: "3.1"
44+
- solidus-branch: "v4.4"
45+
rails-version: "8.0"
46+
env:
47+
TEST_RESULTS_PATH: coverage/coverage.xml
48+
CAPYBARA_JAVASCRIPT_DRIVER: selenium_headless
49+
steps:
50+
- uses: actions/checkout@v4
51+
- name: Run extension tests
52+
uses: solidusio/test-solidus-extension@main
53+
with:
54+
database: ${{ matrix.database }}
55+
rails-version: ${{ matrix.rails-version }}
56+
ruby-version: ${{ matrix.ruby-version }}
57+
solidus-branch: ${{ matrix.solidus-branch }}
58+
- name: Upload coverage reports to Codecov
59+
uses: codecov/codecov-action@v5
60+
continue-on-error: true
61+
with:
62+
token: ${{ secrets.CODECOV_TOKEN }}
63+
files: ${{ env.TEST_RESULTS_PATH }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Solidus Auth Devise
22

3-
[![CircleCI](https://circleci.com/gh/solidusio/solidus_auth_devise.svg?style=shield)](https://circleci.com/gh/solidusio/solidus_auth_devise)
3+
[![Test](https://github.com/solidusio/solidus_auth_devise/actions/workflows/test.yml/badge.svg)](https://github.com/solidusio/solidus_auth_devise/actions/workflows/test.yml)
44
[![codecov](https://codecov.io/gh/solidusio/solidus_auth_devise/branch/main/graph/badge.svg)](https://codecov.io/gh/solidusio/solidus_auth_devise)
55

66
Provides authentication services for Solidus, using the Devise gem.

spec/features/account_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
fill_in "Email", with: user.email
1010
fill_in "Password", with: user.password
1111
click_button "Login"
12+
expect(page).to have_text "Logged in successfully"
1213

1314
click_link "My Account"
1415
expect(page).to have_text "admin@person.com"
@@ -22,6 +23,7 @@
2223
fill_in "Password", with: "password"
2324
fill_in "Password Confirmation", with: "password"
2425
click_button "Create"
26+
expect(page).to have_text "You have signed up successfully"
2527

2628
click_link "My Account"
2729
expect(page).to have_text "email@person.com"
@@ -43,6 +45,7 @@
4345
fill_in "Email", with: user.email
4446
fill_in "Password", with: user.password
4547
click_button "Login"
48+
expect(page).to have_text "Logged in successfully"
4649

4750
click_link "My Account"
4851
expect(page).to have_text "email@person.com"

spec/features/admin/sign_out_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
RSpec.feature "Admin - Sign Out", type: :feature, js: true do
44
given!(:user) do
5-
create :user, email: "email@person.com"
5+
create :admin_user, email: "email@person.com"
66
end
77

88
background do
@@ -12,6 +12,7 @@
1212
# Regression test for #1257
1313
check "Remember me"
1414
click_button "Login"
15+
expect(page).to have_text "Logged in successfully"
1516
end
1617

1718
scenario "allows a signed in user to logout" do

spec/features/admin_permissions_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
fill_in "Email", with: user.email
1111
fill_in "Password", with: user.password
1212
click_button "Login"
13+
expect(page).to have_text "Logged in successfully"
1314
end
1415

1516
context "admin is restricted from accessing orders" do

spec/features/change_email_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
fill_in "spree_user[email]", with: user.email
1212
fill_in "spree_user[password]", with: "secret"
1313
click_button "Login"
14+
expect(page).to have_text "Logged in successfully"
1415

1516
visit spree.edit_account_path
1617
end

spec/features/checkout_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,13 @@
7979
user = create(:user, email: "email@person.com", password: "password", password_confirmation: "password")
8080
click_link "RoR Mug"
8181
click_button "Add To Cart"
82+
within("h1") { expect(page).to have_text "Shopping Cart" }
8283

8384
click_link "Login"
8485
fill_in "Email", with: user.email
8586
fill_in "Password", with: user.password
8687
click_button "Login"
88+
expect(page).to have_text "Logged in successfully"
8789
click_link "Cart"
8890

8991
expect(page).to have_text "RoR Mug"
@@ -112,6 +114,7 @@
112114
create(:user, email: "email@person.com", password: "password", password_confirmation: "password")
113115
click_link "RoR Mug"
114116
click_button "Add To Cart"
117+
within("h1") { expect(page).to have_text "Shopping Cart" }
115118

116119
click_link "Login"
117120
click_link "Forgot Password?"
@@ -142,6 +145,7 @@
142145
scenario "allow a user to register during checkout" do
143146
click_link "RoR Mug"
144147
click_button "Add To Cart"
148+
within("h1") { expect(page).to have_text "Shopping Cart" }
145149
click_button "Checkout"
146150

147151
expect(page).to have_text "Registration"

spec/features/order_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
fill_in "Email", with: user.email
4141
fill_in "Password", with: user.password
4242
click_button "Login"
43+
expect(page).to have_text "Logged in successfully"
4344

4445
# Order should have been merged with first session
4546
click_link "Cart"

spec/features/sign_in_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
fill_in "Email", with: @user.email
4949
fill_in "Password", with: @user.password
5050
click_button "Login"
51+
expect(page).to have_text "Logged in successfully"
5152
expect(current_path).to eq "/account"
5253
end
5354
end

0 commit comments

Comments
 (0)