File tree Expand file tree Collapse file tree 4 files changed +31
-6
lines changed Expand file tree Collapse file tree 4 files changed +31
-6
lines changed Original file line number Diff line number Diff line change 1
1
import Route from '@ember/routing/route' ;
2
+ import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin' ;
2
3
3
- export default Route . extend ( {
4
+ export default Route . extend ( AuthenticatedRouteMixin , {
5
+ titleToken ( ) {
6
+ return this . l10n . t ( 'Billing Info' ) ;
7
+ }
4
8
} ) ;
Original file line number Diff line number Diff line change 1
1
import { module , test } from 'qunit' ;
2
2
import { setupApplicationTest } from 'ember-qunit' ;
3
3
import { currentURL , visit } from '@ember/test-helpers' ;
4
+ import { login } from 'open-event-frontend/tests/helpers/custom-helpers' ;
4
5
5
6
6
7
module ( 'Acceptance | account/billing-info' , function ( hooks ) {
7
8
setupApplicationTest ( hooks ) ;
8
9
9
10
10
- test ( 'visiting account/billing-info' , async function ( assert ) {
11
+ test ( 'visiting account/billing-info without login' , async function ( assert ) {
12
+ await visit ( 'account/billing-info' ) ;
13
+ assert . equal ( currentURL ( ) , '/login' ) ;
14
+ } ) ;
15
+
16
+ test ( 'visiting account/billing-info with login' , async function ( assert ) {
17
+ await login ( assert ) ;
11
18
await visit ( 'account/billing-info' ) ;
12
19
assert . equal ( currentURL ( ) , 'account/billing-info' ) ;
13
20
} ) ;
Original file line number Diff line number Diff line change 1
1
import { module , test } from 'qunit' ;
2
2
import { setupApplicationTest } from 'ember-qunit' ;
3
3
import { currentURL , visit } from '@ember/test-helpers' ;
4
+ import { login } from 'open-event-frontend/tests/helpers/custom-helpers' ;
4
5
5
6
6
7
module ( 'Acceptance | account/billing-info/invoices' , function ( hooks ) {
7
8
setupApplicationTest ( hooks ) ;
8
9
9
10
10
- test ( 'visiting account/billing-info/invoices login' , async function ( assert ) {
11
+ test ( 'visiting account/billing-info/invoices without login' , async function ( assert ) {
11
12
await visit ( 'account/billing-info/invoices' ) ;
12
- assert . equal ( currentURL ( ) , 'account/billing-info/invoices' ) ;
13
+ assert . equal ( currentURL ( ) , '/login' ) ;
14
+ } ) ;
15
+
16
+ test ( 'visiting account/billing-info/invoices with login' , async function ( assert ) {
17
+ await login ( assert ) ;
18
+ await visit ( '/account/billing-info/invoices' ) ;
19
+ assert . equal ( currentURL ( ) , '/account/billing-info/invoices' ) ;
13
20
} ) ;
14
21
} ) ;
Original file line number Diff line number Diff line change 1
1
import { module , test } from 'qunit' ;
2
2
import { setupApplicationTest } from 'ember-qunit' ;
3
3
import { currentURL , visit } from '@ember/test-helpers' ;
4
+ import { login } from 'open-event-frontend/tests/helpers/custom-helpers' ;
4
5
5
6
6
7
module ( 'Acceptance | account/billing-info/payment-info' , function ( hooks ) {
7
8
setupApplicationTest ( hooks ) ;
8
9
9
10
10
- test ( 'visiting account/billing-info/payment-info' , async function ( assert ) {
11
+ test ( 'visiting account/billing-info/payment-info without login ' , async function ( assert ) {
11
12
await visit ( 'account/billing-info/payment-info' ) ;
12
- assert . equal ( currentURL ( ) , 'account/billing-info/payment-info' ) ;
13
+ assert . equal ( currentURL ( ) , '/login' ) ;
14
+ } ) ;
15
+
16
+ test ( 'visiting account/billing-info/payment-info with login' , async function ( assert ) {
17
+ await login ( assert ) ;
18
+ await visit ( '/account/billing-info/payment-info' ) ;
19
+ assert . equal ( currentURL ( ) , '/account/billing-info/payment-info' ) ;
13
20
} ) ;
14
21
} ) ;
You can’t perform that action at this time.
0 commit comments