diff options
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/fixtures/users.json | 11 | ||||
| -rw-r--r-- | spec/task/users_rake_spec.rb | 7 | 
2 files changed, 18 insertions, 0 deletions
diff --git a/spec/fixtures/users.json b/spec/fixtures/users.json index f78e1c445..d5affc81b 100644 --- a/spec/fixtures/users.json +++ b/spec/fixtures/users.json @@ -7,6 +7,7 @@    "phone_number": null,    "created_at": "2016-08-05T12:33:45.152Z",    "updated_at": "2016-08-05T12:33:45.152Z", +  "locked_at": null,    "profile": "Administrateur",    "organization_name": "STIF",    "organization_code": "STIF" @@ -19,6 +20,7 @@    "phone_number": "+336 69 25 15 71",    "created_at": "2016-08-05T12:34:03.049Z",    "updated_at": "2016-08-05T12:34:03.049Z", +  "locked_at": null,    "profile": "Administrateur",    "organization_name": "STIF",    "organization_code": "STIF" @@ -31,6 +33,7 @@    "phone_number": "0697099622",    "created_at": "2016-08-05T12:34:03.161Z",    "updated_at": "2016-08-05T12:34:03.161Z", +  "locked_at": null,    "profile": "Administrateur",    "organization_name": "STIF",    "organization_code": "STIF" @@ -43,6 +46,7 @@    "phone_number": "0033778300069",    "created_at": "2016-08-05T12:34:03.256Z",    "updated_at": "2016-08-05T12:34:03.256Z", +  "locked_at": null,    "profile": "Administrateur",    "organization_name": "STIF",    "organization_code": "STIF" @@ -55,6 +59,7 @@    "phone_number": "0302098171",    "created_at": "2016-08-05T12:34:03.360Z",    "updated_at": "2016-08-05T12:34:03.360Z", +  "locked_at": null,    "profile": "Administrateur",    "organization_name": "STIF",    "organization_code": "STIF" @@ -67,6 +72,7 @@    "phone_number": "0033763987210",    "created_at": "2016-08-05T12:34:03.457Z",    "updated_at": "2016-08-05T12:34:03.457Z", +  "locked_at": null,    "profile": "Administrateur",    "organization_name": "STIF",    "organization_code": "STIF" @@ -79,6 +85,7 @@    "phone_number": "0033790632621",    "created_at": "2016-08-05T12:34:03.553Z",    "updated_at": "2016-08-05T12:34:03.553Z", +  "locked_at": null,    "profile": "Administrateur",    "organization_name": "STIF",    "organization_code": "STIF" @@ -91,6 +98,7 @@    "phone_number": "+33799062141",    "created_at": "2016-08-05T12:34:03.649Z",    "updated_at": "2016-08-05T12:34:03.649Z", +  "locked_at": null,    "profile": "Administrateur",    "organization_name": "STIF",    "organization_code": "STIF" @@ -103,6 +111,7 @@    "phone_number": "+33614563995",    "created_at": "2016-08-05T12:34:03.756Z",    "updated_at": "2016-08-05T12:34:03.756Z", +  "locked_at": null,    "profile": "Administrateur",    "organization_name": "STIF",    "organization_code": "STIF" @@ -115,6 +124,7 @@    "phone_number": "00337 67 87 93 02",    "created_at": "2016-08-05T12:34:03.894Z",    "updated_at": "2016-08-05T12:34:03.894Z", +  "locked_at": null,    "profile": "Référent IV Transporteur",    "organization_name": "RATP",    "organization_code": "RATP" @@ -127,6 +137,7 @@    "phone_number": "+337 07 54 55 73",    "created_at": "2016-08-05T12:34:03.995Z",    "updated_at": "2016-08-05T12:34:03.995Z", +  "locked_at": "2016-08-05T12:34:03.995Z",    "profile": "Référent IV Transporteur",    "organization_name": "RATP",    "organization_code": "RATP" diff --git a/spec/task/users_rake_spec.rb b/spec/task/users_rake_spec.rb index d7c2ed8c9..7f6d3adb5 100644 --- a/spec/task/users_rake_spec.rb +++ b/spec/task/users_rake_spec.rb @@ -39,6 +39,13 @@ describe 'users:sync rake task' do        expect(user.synced_at.utc).to be_within(1.second).of Time.now      end +    it 'should update locked_at attribute' do +      create :user, username: 'alban.peignier', locked_at: Time.now +      run_rake_task +      expect(User.find_by(username: 'alban.peignier').locked_at).to be_nil +      expect(User.find_by(username: 'jane.doe').locked_at).to eq("2016-08-05T12:34:03.995Z") +    end +      it 'should not create new user if username is already present' do        create :user, username: 'alban.peignier'        run_rake_task  | 
