discourse/spec
Andreas Haller 661f2057f7 Improve the omniauth controller specs. Fix the email provided by CAS. Get name from CAS attributes.
* Make omniauth controller specs more robust by using shared examples for all authentication providers in controller spec. – Still passing. Yay!

* Return "casuser", instead of "casuser@" when no cas_domainname is configured.

* If no cas_domainname is configured, the CAS authentication would return "casuser@" for the users email field, because it tried to assume the email adress of the CAS user by it's username + cas_domainname.
  Now it just returns the username instead of adding an "@" if cas_domainname is not configured.
  This especially makes sense on CAS setups where the username equals the users email adress.
  The old behaviour, if cas_domainname is configured, was not changed.

* Fetch the email from CAS attributes if provided
  If the cas:authenticationSuccess (handled via omniauth-cas) response gives us an email use that.
  If not, behave as before (username or username@cas_domainname).

* Fetch the (full) name from CAS attributes if provided
  If the CAS response by omniauth provides a [:info][:name] field, prefer this over the uid, because we want the name to be a "Full Name", instead of just a "shortname"
2013-07-04 12:01:39 +02:00
..
components FIX: Whitespec in specs changed. We should really figure out a better way of ensuring correctness here. 2013-07-03 19:24:49 -04:00
controllers Improve the omniauth controller specs. Fix the email provided by CAS. Get name from CAS attributes. 2013-07-04 12:01:39 +02:00
fabricators do not lightbox oneboxed images 2013-06-24 02:10:21 +02:00
fixtures Fix for multiple paragraph emails with text em-dashes in them (--). 2013-06-25 14:06:05 -04:00
integration If an auto-closing topic is manually closed, remove the auto-close countdown 2013-07-03 16:54:41 -04:00
integrity prevent double work in the i18n integrity specs 2013-03-23 15:49:31 +01:00
mailers Change all headers to X-Discourse-* instead of Discourse-* 2013-06-18 15:54:02 -04:00
models If a user read to the end of an auto closing topic, when it is closes just pretend they read the close message. 2013-07-04 11:47:12 +10:00
phantom_js formatted some tests 2013-02-27 03:18:23 +01:00
requests collapse some slow tests 2013-04-22 11:06:10 +10:00
services Refactor user blocking code; hide the Block button in admin 2013-07-02 14:42:53 -04:00
support Try to fix specs that are failing in jenkins 2013-06-27 17:23:06 -04:00
views/omniauth_callbacks add cas support with a few tests 2013-05-23 13:40:50 -07:00
spec_helper.rb fix all sorts of issues with random spec order 2013-06-23 13:35:25 +10:00