Skip to content

Commit

Permalink
fix: Add failing test case for ory#1725 (ory#1727)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr authored Feb 17, 2020
1 parent e527db2 commit 74d8e31
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions consent/x_manager_sql_migrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ import (
"github.com/jmoiron/sqlx"
"github.com/stretchr/testify/require"

"github.com/ory/x/dbal"
"github.com/ory/x/dbal/migratest"

"github.com/ory/hydra/client"
"github.com/ory/hydra/consent"
"github.com/ory/hydra/internal"
"github.com/ory/hydra/x"
"github.com/ory/x/dbal"
"github.com/ory/x/dbal/migratest"
)

func TestXXMigrations(t *testing.T) {
Expand Down Expand Up @@ -60,6 +61,15 @@ func TestXXMigrations(t *testing.T) {
require.NoError(t, err, "%d-login-session-id", kk)
_, err = s.GetConsentRequest(context.TODO(), fmt.Sprintf("%d-challenge", kk))
require.NoError(t, err, "%d-challenge", kk)

rs, err := s.FindGrantedAndRememberedConsentRequests(context.TODO(), fmt.Sprintf("%d-client", kk), fmt.Sprintf("%d-subject", kk))
require.NoError(t, err, "%d-challenge %d-subject", kk, kk)
require.True(t, len(rs) > 0)

rs, err = s.FindSubjectsGrantedConsentRequests(context.TODO(), fmt.Sprintf("%d-subject", kk), 1, 0)
require.NoError(t, err, "%d-challenge %d-subject", kk, kk)
require.True(t, len(rs) > 0)

if step > 1 {
_, err = s.GetForcedObfuscatedLoginSession(context.TODO(), fmt.Sprintf("%d-client", kk), fmt.Sprintf("%d-obfuscated", kk))
require.NoError(t, err, "%d-client", kk)
Expand Down

0 comments on commit 74d8e31

Please sign in to comment.