summaryrefslogtreecommitdiff
path: root/test/unit
AgeCommit message (Collapse)Author
2018-01-31keys: store type and rev in hash rather than serializedAzul
Since the old keys used to be strings i started out by json serializing the new keys with type, value, rev. However storing serialized json in couch (json) does not really make sense. So now we do not serialize but instead have one json document. The lookup for a key of type pgp may still return a string but for everything that uses the new api it will return a hash with type and revision. This data structure is way easier to handle also on the nickserver side.
2018-01-19API: implement deleting keys through new keys apiAzul
2018-01-18(WIP) first steps towards implementing keys APIAzul
2017-12-08upgrade: factory_girl -> factory_botAzul
2017-11-16minor: clean up account testAzul
also ensures that created user is cleaned up even if test fails
2017-10-24fix: also remove invite codes used for tmp usersAzul
fixes #8807
2017-10-17fix: destroy invites used to create test accountsAzul
Production instances are getting cluttered with invites from test accounts. Instead of marking them as used we will now completely remove them. refers to #8804 refers to #8807\
2017-08-07prevent token conflictsAzul
2017-03-22upgrade: bundleAzul
update all the dependencies. minitest now wants assert_nil instead of assert_equal nil, ... braintree now uses update_attributes rather than save.
2017-03-10Validates recovery code as hexadecimal data.Thais Siqueira
Related with https://github.com/pixelated/pixelated-user-agent/issues/924 With @aarni
2017-03-10Adds recovery code to user accountThais Siqueira
Related with https://github.com/pixelated/pixelated-user-agent/issues/924 With @aarni
2016-11-17bugfix: only send login errors onceAzul
If a login was invalid as a username but also for the identity we used to have duplicate error messages. Let's avoid that. Also added a test to make sure invite_code errors are properly displayed no matter what other fields are set or missing. Pixelated will rely on this to test invite codes
2016-08-12[db] def database on users instead of use_databaseAzul
use_database affects all uses of prepare_database - so also the one in tmp_database. In order to avoid that we do not use_database but just overwrite the database method itself.
2016-07-14[feature] restrict is_admin in the user api, to only allow queryingNavaL
for him/herself So that it we do not expose the is_admin property to anyone else including other admins.
2016-07-14Merge branch 'develop' of https://github.com/leapcode/leap_web into ↵NavaL
feature/expose_admin_in_api
2016-07-05fix email unit test - need to require nowAzul
2016-06-22[feature] expose is_admin in the user apiNavaL
So that whoever consumes the API can use this attribute to determine if admin functionalities should be made available to the current user.
2016-05-09test: make identity test locale independentAzul
It somehow managed to fail for a certain test order. Seems rather rare though - have not been able to reproduce it in 5 runs. Failed with --seed 60219.
2016-05-02tests: Validator.new has optional options hashAzul
but you may not hand it a nil
2016-05-02upgrade: unique test namesAzul
Rails 4.2 runs all tests mixed together. So unit tests and integration tests may not have conflicting names.
2016-04-11allow monitor auth to create users even if invites are normally required.elijah
2016-03-28api tokens - clarify terms: "monitors" are admins that authenticated via api ↵elijah
token, "tmp" users are users that exist only in tmp db, "test" users are either tmp users or users named "test_user_x"
2016-03-28api tokens: allow for special api tokens that work like session tokens but ↵elijah
are configured in the static config, to be used for infrastructure monitoring.
2016-02-10allow user accounts to be re-enabled, and for associated identities to also ↵elijah
get re-enabled.
2016-01-31remove cert fingerprints for disabled users, so that they cannot send email ↵elijah
anymore. closes #7690
2015-10-06Integrated feedback on multi-invite codesankonym
Removing some superfluous code, mostly, and structuring tests better.
2015-10-02Update rake task to allow generation of multi-use invitesankonym
The rake task now takes a second (optional) argument that sets the number of uses per invite code. If this is omitted, the default number of uses is 1. (This commit also contains some minor code cleanup that removes some stuff that I'd commented out but not removed.)
2015-10-02Allow multi-use invite codesankonym
Introduce a invite_max_uses property to invite codes to allow admins to set a maximum number of uses for invite codes.
2015-09-28Make invite code configurableankonym
Through the config param 'invite_required', providers can decide whether users need to provide an invite code upon signup. The default setting is false.
2015-09-28Removed the view_by__id from invite code testankonym
2015-09-28Fixed the signup bug that wrongly consumes the invite code.Aya Jaff
2015-09-28Fix three unit tests by passing Factory Girl a valid invite codeankonym
The tests were failing because of a hardcoded "testcode" string so during test setup we generate a valid code and pass it to Factory Girl
2015-09-28Fix several test failures by stubbing invite code validationankonym
2015-09-28Separate user and invite code validator testsankonym
2015-09-28Fixes for the invite code validatorankonym
Validation should only happen for new records User invite code was nil for invalid invite codes Adding missing tests
2015-09-28Make sure codes can only be used once, fix validationsankonym
We introduced a count on invite codes to make sure that (at the moment) codes can only be used once. (The code will also allow multi-use codes in the future.) Also, some of our validations weren't validating against the correct data, which is now fixed.
2015-09-28assign random invite code when creating new invite codesankonym
2015-09-28Fix test based on actual invite code validationankonym
2015-09-28Added an 'invite code' to all the tests for the sign-up form so we have a ↵Aya Jaff
valid user for the tests again
2015-09-28Adding invite code field to signup with validation for hardcoded invite codeankonym
2015-09-10couchrest_model 2.0.1 fixes find_by_sth(nil)Azul
This used to return the first record! :scream: This [commit](https://github.com/couchrest/couchrest_model/commit/2c5b76823e94caed4d8cbfbf18cb9e0d58789789) is essential for say User.find_by_login(nil) to NOT return the first record in the database.
2015-08-07do not include random cruft in the common name of smtp client certificateselijah
2015-03-17add support for rotating tokens and sessions databases, and for a special ↵elijah
tmp db for test users.
2014-07-14minor: remove @s added by search and replaceAzul
meant to move id -> @id, also turned identity in the test titles into @identity.
2014-07-14minor: fix identity test for storing certsAzul
we compare the cert that expires last to the one we just saved. So we need to make sure the one we saved is the one that expires last.
2014-07-12allow querying for the expiry of a particular fingerprintAzul
2014-07-12Identity view cert_fingerprints_by_expiryAzul
Also move complex identity views into js designs. Includes test. Here's how you would query it from outside rails: ``` $ curl 'localhost:5984/identities/_design/Identity/_view/cert_fingerprints_by_expiry?startkey="2014-07-05"' {"total_rows":4,"offset":1,"rows":[ {"id":"6c9091d4f13eaeaa6062c9d0528fd34d","key":"2014-07-05","value":"fingerprint"}, {"id":"6f3aa93828b4f6978d551f2623b9d103","key":"2014-07-05","value":"fingerprint"}, {"id":"b6cafacfa65042679691cd5065fb19e3","key":"2014-07-07","value":"fp"} ]} ``` Note that the expiry will be used as the key. So you should use the current data (or yesterday) as the startkey to get all fingerprints that have not expired yet. The fingerprint itself is in the value. No need to include docs.
2014-05-29clearify identity validationsAzul
Identity.new.valid? should not crash. So validate presence where needed and skip the other validations if the value is absent.
2014-05-29hand on errors from Email to Identity to UserAzul
errors.each iterates through all errors for all attrbibutes nicely.
2014-05-28adopt tests to new error messages for identitiesAzul