@@ -3,14 +3,17 @@ import { module, test } from 'qunit';
3
3
import startApp from '../helpers/start-app' ;
4
4
import FactoryGuy from 'ember-data-factory-guy' ;
5
5
import '../factories/designation' ;
6
+ import '../factories/location' ;
6
7
import { mockFindAll } from 'ember-data-factory-guy' ;
7
8
8
- var App , designation , item , item1 , orders_package , orders_package1 ;
9
+ var App , designation , item , item1 , orders_package , orders_package1 , location1 ;
9
10
10
11
module ( 'Acceptance: Add item to order' , {
11
12
beforeEach : function ( ) {
12
13
App = startApp ( { } , 2 ) ;
13
14
designation = FactoryGuy . make ( "designation" ) ;
15
+ location1 = FactoryGuy . make ( "location" ) ;
16
+ mockFindAll ( 'location' ) . returns ( { json : { locations : [ location1 . toJSON ( { includeId : true } ) ] } } ) ;
14
17
var data = { "user_profile" : { "id" : 2 , "first_name" : "David" , "last_name" : "Dara51" , "mobile" : "61111111" , "permission_id" : 4 } , "permissions" : [ { "id" : 4 , "name" : "Supervisor" } ] } ;
15
18
16
19
$ . mockjax ( { url :"/api/v1/auth/current_user_profil*" ,
@@ -20,7 +23,11 @@ module('Acceptance: Add item to order', {
20
23
orders_package = FactoryGuy . make ( "orders_package" , { state : "designated" , quantity : 6 , item : item , designation : designation } ) ;
21
24
orders_package1 = FactoryGuy . make ( "orders_package" , { state : "dispatched" , quantity : 4 , item : item1 , designation : designation } ) ;
22
25
23
- visit ( "/orders/" ) ;
26
+ visit ( "/" ) ;
27
+
28
+ andThen ( function ( ) {
29
+ visit ( "/orders/" ) ;
30
+ } ) ;
24
31
25
32
fillIn ( '#searchText' , designation . get ( "code" ) ) ;
26
33
andThen ( function ( ) {
0 commit comments