diff --git a/app/assets/javascripts/discourse/routes/application.js.es6 b/app/assets/javascripts/discourse/routes/application.js.es6 index b3d476cd57c..4225c1b686a 100644 --- a/app/assets/javascripts/discourse/routes/application.js.es6 +++ b/app/assets/javascripts/discourse/routes/application.js.es6 @@ -8,8 +8,15 @@ var ApplicationRoute = Em.Route.extend({ return; } - var exceptionController = this.controllerFor('exception'); - Em.warn(err); + var exceptionController = this.controllerFor('exception'), + errorString = err.toString(); + if (err.statusText) { + errorString = err.statusText; + } + var c = window.console; + if (c && c.error) { + c.error(errorString); + } exceptionController.setProperties({ lastTransition: transition, thrown: err }); this.intermediateTransitionTo('exception'); diff --git a/test/javascripts/fixtures/badges_fixture.js b/test/javascripts/fixtures/badges_fixture.js new file mode 100644 index 00000000000..c9f5ea22162 --- /dev/null +++ b/test/javascripts/fixtures/badges_fixture.js @@ -0,0 +1,4 @@ +/*jshint maxlen:10000000 */ +Discourse.URL_FIXTURES["/badges.json?only_listable=true"] = {"badge_types":[{"id":2,"name":"Silver"},{"id":3,"name":"Bronze"},{"id":1,"name":"Gold"}],"badge_groupings":[{"id":8,"name":"Development","description":null,"position":5},{"id":4,"name":"Trust Level","description":null,"position":3},{"id":7,"name":"Testing","description":null,"position":4},{"id":1,"name":"Getting Started","description":null,"position":0},{"id":3,"name":"Posting","description":null,"position":2},{"id":2,"name":"Community","description":null,"position":1}],"badges":[{"id":108,"name":"Great contributor","description":"contributed 25 accepted pull request","grant_count":11,"allow_title":true,"multiple_grant":false,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":8,"system":false,"badge_type_id":2},{"id":118,"name":"Plugin Author","description":"Developed a plugin for Discourse ","grant_count":10,"allow_title":true,"multiple_grant":false,"icon":"fa-cog","listable":true,"enabled":true,"badge_grouping_id":8,"system":false,"badge_type_id":2},{"id":3,"name":"Leader","description":null,"grant_count":29,"allow_title":true,"multiple_grant":false,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":4,"system":true,"badge_type_id":2},{"id":107,"name":"Contributor","description":"contributed an accepted pull request","grant_count":200,"allow_title":false,"multiple_grant":false,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":8,"system":false,"badge_type_id":3},{"id":116,"name":"Tester","description":"Reported 10 bugs that were liked by the Discourse team","grant_count":9,"allow_title":true,"multiple_grant":false,"icon":"fa-bug","listable":true,"enabled":true,"badge_grouping_id":7,"system":false,"badge_type_id":2},{"id":109,"name":"Amazing contributor","description":"contributed 250 accepted pull request","grant_count":0,"allow_title":true,"multiple_grant":false,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":8,"system":false,"badge_type_id":1},{"id":2,"name":"Regular User","description":null,"grant_count":467,"allow_title":false,"multiple_grant":false,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":4,"system":true,"badge_type_id":3},{"id":114,"name":"Bug Reporter","description":"Reported a bug that was liked by the Discourse team","grant_count":183,"allow_title":false,"multiple_grant":false,"icon":"fa-bug","listable":true,"enabled":true,"badge_grouping_id":7,"system":false,"badge_type_id":3},{"id":4,"name":"Elder","description":null,"grant_count":4,"allow_title":true,"multiple_grant":false,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":4,"system":true,"badge_type_id":1},{"id":17,"name":"Reader","description":null,"grant_count":278,"allow_title":false,"multiple_grant":false,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":1,"system":true,"badge_type_id":3},{"id":1,"name":"Basic User","description":null,"grant_count":5834,"allow_title":false,"multiple_grant":false,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":4,"system":true,"badge_type_id":3},{"id":16,"name":"Read Guidelines","description":null,"grant_count":60,"allow_title":false,"multiple_grant":false,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":1,"system":true,"badge_type_id":3},{"id":7,"name":"Good Post","description":null,"grant_count":22,"allow_title":false,"multiple_grant":true,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":3,"system":true,"badge_type_id":2},{"id":8,"name":"Great Post","description":null,"grant_count":2,"allow_title":false,"multiple_grant":true,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":3,"system":true,"badge_type_id":1},{"id":11,"name":"First Like","description":null,"grant_count":2387,"allow_title":false,"multiple_grant":false,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":1,"system":true,"badge_type_id":3},{"id":12,"name":"First Share","description":null,"grant_count":285,"allow_title":false,"multiple_grant":false,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":1,"system":true,"badge_type_id":3},{"id":13,"name":"First Flag","description":null,"grant_count":42,"allow_title":false,"multiple_grant":false,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":2,"system":true,"badge_type_id":3},{"id":5,"name":"Welcome","description":null,"grant_count":1718,"allow_title":false,"multiple_grant":false,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":2,"system":true,"badge_type_id":3},{"id":15,"name":"First Quote","description":null,"grant_count":270,"allow_title":false,"multiple_grant":false,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":1,"system":true,"badge_type_id":3},{"id":9,"name":"Autobiographer","description":null,"grant_count":545,"allow_title":false,"multiple_grant":false,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":1,"system":true,"badge_type_id":3},{"id":14,"name":"First Link","description":null,"grant_count":397,"allow_title":false,"multiple_grant":false,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":1,"system":true,"badge_type_id":3},{"id":6,"name":"Nice Post","description":null,"grant_count":259,"allow_title":false,"multiple_grant":true,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":3,"system":true,"badge_type_id":3},{"id":10,"name":"Editor","description":null,"grant_count":933,"allow_title":false,"multiple_grant":false,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":2,"system":true,"badge_type_id":3}]}; +Discourse.URL_FIXTURES["/badges/9"] = {"badge_types":[{"id":3,"name":"Bronze"}],"badge":{"id":9,"name":"Autobiographer","description":null,"grant_count":545,"allow_title":false,"multiple_grant":false,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":1,"system":true,"badge_type_id":3}}; +Discourse.URL_FIXTURES["/user_badges.json"] = {"badges":[{"id":9,"name":"Autobiographer","description":null,"grant_count":545,"allow_title":false,"multiple_grant":false,"icon":"fa-certificate","listable":true,"enabled":true,"badge_grouping_id":1,"system":true,"badge_type_id":3}],"badge_types":[{"id":3,"name":"Bronze"}],"users":[{"id":11209,"username":"icaroperseo","uploaded_avatar_id":33076,"avatar_template":"/user_avatar/meta.discourse.org/icaroperseo/{size}/33076.png"},{"id":-1,"username":"system","uploaded_avatar_id":5241,"avatar_template":"/user_avatar/meta.discourse.org/system/{size}/5241.png"},{"id":11234,"username":"allard","uploaded_avatar_id":33117,"avatar_template":"/user_avatar/meta.discourse.org/allard/{size}/33117.png"},{"id":8944,"username":"hunterboerner","uploaded_avatar_id":33072,"avatar_template":"/user_avatar/meta.discourse.org/hunterboerner/{size}/33072.png"},{"id":11232,"username":"daydreamer","uploaded_avatar_id":33101,"avatar_template":"/user_avatar/meta.discourse.org/daydreamer/{size}/33101.png"},{"id":11160,"username":"boomzilla","uploaded_avatar_id":33029,"avatar_template":"/user_avatar/meta.discourse.org/boomzilla/{size}/33029.png"},{"id":5303,"username":"ybart","uploaded_avatar_id":14132,"avatar_template":"/user_avatar/meta.discourse.org/ybart/{size}/14132.png"},{"id":11142,"username":"Fluffy","uploaded_avatar_id":32957,"avatar_template":"/user_avatar/meta.discourse.org/fluffy/{size}/32957.png"},{"id":8843,"username":"timoroso","uploaded_avatar_id":19114,"avatar_template":"/user_avatar/meta.discourse.org/timoroso/{size}/19114.png"},{"id":10990,"username":"Nagesh","uploaded_avatar_id":32736,"avatar_template":"/user_avatar/meta.discourse.org/nagesh/{size}/32736.png"},{"id":11027,"username":"dullroar","uploaded_avatar_id":32801,"avatar_template":"/user_avatar/meta.discourse.org/dullroar/{size}/32801.png"},{"id":10481,"username":"Air_Cooled_Nut","uploaded_avatar_id":31833,"avatar_template":"/user_avatar/meta.discourse.org/air_cooled_nut/{size}/31833.png"},{"id":10977,"username":"stevebridger","uploaded_avatar_id":32705,"avatar_template":"/user_avatar/meta.discourse.org/stevebridger/{size}/32705.png"},{"id":10921,"username":"lnikkila","uploaded_avatar_id":32627,"avatar_template":"/user_avatar/meta.discourse.org/lnikkila/{size}/32627.png"},{"id":8493,"username":"PJH","uploaded_avatar_id":33082,"avatar_template":"/user_avatar/meta.discourse.org/pjh/{size}/33082.png"},{"id":10635,"username":"Ganzuelo","uploaded_avatar_id":32217,"avatar_template":"/user_avatar/meta.discourse.org/ganzuelo/{size}/32217.png"},{"id":8300,"username":"cpradio","uploaded_avatar_id":4970,"avatar_template":"/user_avatar/meta.discourse.org/cpradio/{size}/4970.png"},{"id":8571,"username":"tobiaseigen","uploaded_avatar_id":9785,"avatar_template":"/user_avatar/meta.discourse.org/tobiaseigen/{size}/9785.png"},{"id":4263,"username":"mcwumbly","uploaded_avatar_id":9796,"avatar_template":"/user_avatar/meta.discourse.org/mcwumbly/{size}/9796.png"},{"id":471,"username":"BhaelOchon","uploaded_avatar_id":6069,"avatar_template":"/user_avatar/meta.discourse.org/bhaelochon/{size}/6069.png"},{"id":5249,"username":"cawas","uploaded_avatar_id":14043,"avatar_template":"/user_avatar/meta.discourse.org/cawas/{size}/14043.png"},{"id":5461,"username":"thepractice","uploaded_avatar_id":2397,"avatar_template":"/user_avatar/meta.discourse.org/thepractice/{size}/2397.png"},{"id":10467,"username":"chris18890","uploaded_avatar_id":31806,"avatar_template":"/user_avatar/meta.discourse.org/chris18890/{size}/31806.png"},{"id":375,"username":"weirdcanada","uploaded_avatar_id":5902,"avatar_template":"/user_avatar/meta.discourse.org/weirdcanada/{size}/5902.png"},{"id":8617,"username":"Mittineague","uploaded_avatar_id":4462,"avatar_template":"/user_avatar/meta.discourse.org/mittineague/{size}/4462.png"},{"id":5962,"username":"TheMarkus","uploaded_avatar_id":15186,"avatar_template":"/user_avatar/meta.discourse.org/themarkus/{size}/15186.png"},{"id":2806,"username":"fayimora","uploaded_avatar_id":10007,"avatar_template":"/user_avatar/meta.discourse.org/fayimora/{size}/10007.png"},{"id":8364,"username":"codetricity","uploaded_avatar_id":3773,"avatar_template":"/user_avatar/meta.discourse.org/codetricity/{size}/3773.png"},{"id":3752,"username":"liberatiluca","uploaded_avatar_id":11568,"avatar_template":"/user_avatar/meta.discourse.org/liberatiluca/{size}/11568.png"},{"id":3483,"username":"Packetknife","uploaded_avatar_id":11144,"avatar_template":"/user_avatar/meta.discourse.org/packetknife/{size}/11144.png"},{"id":32,"username":"codinghorror","uploaded_avatar_id":5297,"avatar_template":"/user_avatar/meta.discourse.org/codinghorror/{size}/5297.png"},{"id":19,"username":"eviltrout","uploaded_avatar_id":5275,"avatar_template":"/user_avatar/meta.discourse.org/eviltrout/{size}/5275.png"},{"id":7229,"username":"DavidGNavas","uploaded_avatar_id":17081,"avatar_template":"/user_avatar/meta.discourse.org/davidgnavas/{size}/17081.png"},{"id":1219,"username":"Gweebz","uploaded_avatar_id":7304,"avatar_template":"/user_avatar/meta.discourse.org/gweebz/{size}/7304.png"},{"id":7743,"username":"ZeroFlux","uploaded_avatar_id":2256,"avatar_template":"/user_avatar/meta.discourse.org/zeroflux/{size}/2256.png"},{"id":8510,"username":"tannerfilip","uploaded_avatar_id":18674,"avatar_template":"/user_avatar/meta.discourse.org/tannerfilip/{size}/18674.png"},{"id":1496,"username":"cfstras","uploaded_avatar_id":7776,"avatar_template":"/user_avatar/meta.discourse.org/cfstras/{size}/7776.png"},{"id":3986,"username":"creativetech","uploaded_avatar_id":11955,"avatar_template":"/user_avatar/meta.discourse.org/creativetech/{size}/11955.png"},{"id":3800,"username":"stealthii","uploaded_avatar_id":11645,"avatar_template":"/user_avatar/meta.discourse.org/stealthii/{size}/11645.png"},{"id":6613,"username":"haiku","uploaded_avatar_id":9781,"avatar_template":"/user_avatar/meta.discourse.org/haiku/{size}/9781.png"},{"id":5351,"username":"erlend_sh","uploaded_avatar_id":9794,"avatar_template":"/user_avatar/meta.discourse.org/erlend_sh/{size}/9794.png"},{"id":5983,"username":"JohnSReid","uploaded_avatar_id":32238,"avatar_template":"/user_avatar/meta.discourse.org/johnsreid/{size}/32238.png"},{"id":701,"username":"johncoder","uploaded_avatar_id":6447,"avatar_template":"/user_avatar/meta.discourse.org/johncoder/{size}/6447.png"},{"id":5707,"username":"trident","uploaded_avatar_id":31178,"avatar_template":"/user_avatar/meta.discourse.org/trident/{size}/31178.png"},{"id":255,"username":"uwe_keim","uploaded_avatar_id":5697,"avatar_template":"/user_avatar/meta.discourse.org/uwe_keim/{size}/5697.png"},{"id":9931,"username":"Frank","uploaded_avatar_id":32861,"avatar_template":"/user_avatar/meta.discourse.org/frank/{size}/32861.png"},{"id":5543,"username":"trevor","uploaded_avatar_id":14507,"avatar_template":"/user_avatar/meta.discourse.org/trevor/{size}/14507.png"},{"id":3987,"username":"Sander78","uploaded_avatar_id":9787,"avatar_template":"/user_avatar/meta.discourse.org/sander78/{size}/9787.png"},{"id":7850,"username":"tudorv","uploaded_avatar_id":2568,"avatar_template":"/user_avatar/meta.discourse.org/tudorv/{size}/2568.png"},{"id":6653,"username":"amitfrid","uploaded_avatar_id":16262,"avatar_template":"/user_avatar/meta.discourse.org/amitfrid/{size}/16262.png"},{"id":4419,"username":"sasivarnakumar","uploaded_avatar_id":12661,"avatar_template":"/user_avatar/meta.discourse.org/sasivarnakumar/{size}/12661.png"},{"id":5710,"username":"elvanja","uploaded_avatar_id":14781,"avatar_template":"/user_avatar/meta.discourse.org/elvanja/{size}/14781.png"},{"id":5401,"username":"nilaykumar","uploaded_avatar_id":14275,"avatar_template":"/user_avatar/meta.discourse.org/nilaykumar/{size}/14275.png"},{"id":6809,"username":"buster","uploaded_avatar_id":31175,"avatar_template":"/user_avatar/meta.discourse.org/buster/{size}/31175.png"},{"id":169,"username":"blowmage","uploaded_avatar_id":5545,"avatar_template":"/user_avatar/meta.discourse.org/blowmage/{size}/5545.png"},{"id":766,"username":"dworthley","uploaded_avatar_id":6561,"avatar_template":"/user_avatar/meta.discourse.org/dworthley/{size}/6561.png"},{"id":1612,"username":"trottier","uploaded_avatar_id":7977,"avatar_template":"/user_avatar/meta.discourse.org/trottier/{size}/7977.png"},{"id":6019,"username":"mandie","uploaded_avatar_id":15273,"avatar_template":"/user_avatar/meta.discourse.org/mandie/{size}/15273.png"},{"id":3724,"username":"Manikin75","uploaded_avatar_id":11520,"avatar_template":"/user_avatar/meta.discourse.org/manikin75/{size}/11520.png"},{"id":1556,"username":"OfferKaye","uploaded_avatar_id":7878,"avatar_template":"/user_avatar/meta.discourse.org/offerkaye/{size}/7878.png"},{"id":4063,"username":"blanco","uploaded_avatar_id":12082,"avatar_template":"/user_avatar/meta.discourse.org/blanco/{size}/12082.png"},{"id":1621,"username":"bnb","uploaded_avatar_id":7992,"avatar_template":"/user_avatar/meta.discourse.org/bnb/{size}/7992.png"},{"id":3095,"username":"ayush","uploaded_avatar_id":10504,"avatar_template":"/user_avatar/meta.discourse.org/ayush/{size}/10504.png"},{"id":754,"username":"danneu","uploaded_avatar_id":6540,"avatar_template":"/user_avatar/meta.discourse.org/danneu/{size}/6540.png"},{"id":6548,"username":"michaeld","uploaded_avatar_id":1594,"avatar_template":"/user_avatar/meta.discourse.org/michaeld/{size}/1594.png"},{"id":4457,"username":"Lee_Ars","uploaded_avatar_id":1597,"avatar_template":"/user_avatar/meta.discourse.org/lee_ars/{size}/1597.png"},{"id":5160,"username":"eriko","uploaded_avatar_id":1915,"avatar_template":"/user_avatar/meta.discourse.org/eriko/{size}/1915.png"},{"id":10150,"username":"ampburner","uploaded_avatar_id":5103,"avatar_template":"/user_avatar/meta.discourse.org/ampburner/{size}/5103.png"},{"id":1,"username":"sam","uploaded_avatar_id":5243,"avatar_template":"/user_avatar/meta.discourse.org/sam/{size}/5243.png"},{"id":1995,"username":"zogstrip","uploaded_avatar_id":8630,"avatar_template":"/user_avatar/meta.discourse.org/zogstrip/{size}/8630.png"},{"id":9536,"username":"nahtnam","uploaded_avatar_id":20077,"avatar_template":"/user_avatar/meta.discourse.org/nahtnam/{size}/20077.png"},{"id":5559,"username":"downey","uploaded_avatar_id":14532,"avatar_template":"/user_avatar/meta.discourse.org/downey/{size}/14532.png"},{"id":6626,"username":"riking","uploaded_avatar_id":9779,"avatar_template":"/user_avatar/meta.discourse.org/riking/{size}/9779.png"},{"id":562,"username":"nightpool","uploaded_avatar_id":6220,"avatar_template":"/user_avatar/meta.discourse.org/nightpool/{size}/6220.png"},{"id":2770,"username":"awesomerobot","uploaded_avatar_id":32393,"avatar_template":"/user_avatar/meta.discourse.org/awesomerobot/{size}/32393.png"},{"id":4385,"username":"jeans","uploaded_avatar_id":12606,"avatar_template":"/user_avatar/meta.discourse.org/jeans/{size}/12606.png"},{"id":8222,"username":"techAPJ","uploaded_avatar_id":3281,"avatar_template":"/user_avatar/meta.discourse.org/techapj/{size}/3281.png"},{"id":1274,"username":"binaryphile","uploaded_avatar_id":7399,"avatar_template":"/user_avatar/meta.discourse.org/binaryphile/{size}/7399.png"},{"id":15,"username":"Hanzo","uploaded_avatar_id":5267,"avatar_template":"/user_avatar/meta.discourse.org/hanzo/{size}/5267.png"},{"id":5199,"username":"sefier","uploaded_avatar_id":31207,"avatar_template":"/user_avatar/meta.discourse.org/sefier/{size}/31207.png"},{"id":2316,"username":"pakl","uploaded_avatar_id":9157,"avatar_template":"/user_avatar/meta.discourse.org/pakl/{size}/9157.png"},{"id":393,"username":"freney","uploaded_avatar_id":5932,"avatar_template":"/user_avatar/meta.discourse.org/freney/{size}/5932.png"},{"id":8492,"username":"Onaldan","uploaded_avatar_id":18651,"avatar_template":"/user_avatar/meta.discourse.org/onaldan/{size}/18651.png"},{"id":5002,"username":"jakeberger","uploaded_avatar_id":13630,"avatar_template":"/user_avatar/meta.discourse.org/jakeberger/{size}/13630.png"},{"id":2544,"username":"davideyre","uploaded_avatar_id":9543,"avatar_template":"/user_avatar/meta.discourse.org/davideyre/{size}/9543.png"},{"id":8342,"username":"sethuv","uploaded_avatar_id":3036,"avatar_template":"/user_avatar/meta.discourse.org/sethuv/{size}/3036.png"},{"id":1128,"username":"Tigraine","uploaded_avatar_id":7152,"avatar_template":"/user_avatar/meta.discourse.org/tigraine/{size}/7152.png"},{"id":2477,"username":"billybonks","uploaded_avatar_id":9430,"avatar_template":"/user_avatar/meta.discourse.org/billybonks/{size}/9430.png"},{"id":4549,"username":"davidcelis","uploaded_avatar_id":12882,"avatar_template":"/user_avatar/meta.discourse.org/davidcelis/{size}/12882.png"},{"id":7264,"username":"etrowbridge","uploaded_avatar_id":31199,"avatar_template":"/user_avatar/meta.discourse.org/etrowbridge/{size}/31199.png"},{"id":413,"username":"adam_baldwin","uploaded_avatar_id":5962,"avatar_template":"/user_avatar/meta.discourse.org/adam_baldwin/{size}/5962.png"},{"id":8658,"username":"Datachick","uploaded_avatar_id":18865,"avatar_template":"/user_avatar/meta.discourse.org/datachick/{size}/18865.png"},{"id":5294,"username":"madbomber","uploaded_avatar_id":14118,"avatar_template":"/user_avatar/meta.discourse.org/madbomber/{size}/14118.png"},{"id":4750,"username":"dainbinder","uploaded_avatar_id":13220,"avatar_template":"/user_avatar/meta.discourse.org/dainbinder/{size}/13220.png"},{"id":2735,"username":"royce_williams","uploaded_avatar_id":9887,"avatar_template":"/user_avatar/meta.discourse.org/royce_williams/{size}/9887.png"},{"id":9089,"username":"Keezer","uploaded_avatar_id":31186,"avatar_template":"/user_avatar/meta.discourse.org/keezer/{size}/31186.png"}],"user_badges":[{"id":39085,"granted_at":"2014-07-30T20:06:09.461-04:00","badge_id":9,"user_id":11209,"granted_by_id":-1},{"id":39035,"granted_at":"2014-07-29T15:26:57.028-04:00","badge_id":9,"user_id":11234,"granted_by_id":-1},{"id":39034,"granted_at":"2014-07-29T14:28:43.359-04:00","badge_id":9,"user_id":8944,"granted_by_id":-1},{"id":39027,"granted_at":"2014-07-29T13:14:40.612-04:00","badge_id":9,"user_id":11232,"granted_by_id":-1},{"id":38874,"granted_at":"2014-07-25T14:39:57.034-04:00","badge_id":9,"user_id":11160,"granted_by_id":-1},{"id":38866,"granted_at":"2014-07-25T05:10:33.585-04:00","badge_id":9,"user_id":5303,"granted_by_id":-1},{"id":38838,"granted_at":"2014-07-24T11:57:21.389-04:00","badge_id":9,"user_id":11142,"granted_by_id":-1},{"id":37659,"granted_at":"2014-07-22T03:11:21.336-04:00","badge_id":9,"user_id":8843,"granted_by_id":-1},{"id":37611,"granted_at":"2014-07-21T13:02:19.724-04:00","badge_id":9,"user_id":10990,"granted_by_id":-1},{"id":37537,"granted_at":"2014-07-19T13:56:59.699-04:00","badge_id":9,"user_id":11027,"granted_by_id":-1},{"id":37497,"granted_at":"2014-07-18T10:03:45.294-04:00","badge_id":9,"user_id":10481,"granted_by_id":-1},{"id":37217,"granted_at":"2014-07-15T15:29:45.464-04:00","badge_id":9,"user_id":10977,"granted_by_id":-1},{"id":36865,"granted_at":"2014-07-12T08:45:09.386-04:00","badge_id":9,"user_id":10921,"granted_by_id":-1},{"id":36126,"granted_at":"2014-07-09T08:02:43.143-04:00","badge_id":9,"user_id":8493,"granted_by_id":-1},{"id":32551,"granted_at":"2014-07-06T00:07:44.455-04:00","badge_id":9,"user_id":10635,"granted_by_id":-1},{"id":32550,"granted_at":"2014-07-05T17:45:16.661-04:00","badge_id":9,"user_id":8300,"granted_by_id":-1},{"id":15327,"granted_at":"2014-07-04T16:03:28.852-04:00","badge_id":9,"user_id":8571,"granted_by_id":-1},{"id":7787,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":4263,"granted_by_id":-1},{"id":7786,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":471,"granted_by_id":-1},{"id":7785,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":5249,"granted_by_id":-1},{"id":7784,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":5461,"granted_by_id":-1},{"id":7783,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":10467,"granted_by_id":-1},{"id":7782,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":375,"granted_by_id":-1},{"id":7781,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":8617,"granted_by_id":-1},{"id":7780,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":5962,"granted_by_id":-1},{"id":7779,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":2806,"granted_by_id":-1},{"id":7778,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":8364,"granted_by_id":-1},{"id":7777,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":3752,"granted_by_id":-1},{"id":7776,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":3483,"granted_by_id":-1},{"id":7775,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":32,"granted_by_id":-1},{"id":7774,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":19,"granted_by_id":-1},{"id":7773,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":7229,"granted_by_id":-1},{"id":7772,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":1219,"granted_by_id":-1},{"id":7771,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":7743,"granted_by_id":-1},{"id":7770,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":8510,"granted_by_id":-1},{"id":7769,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":1496,"granted_by_id":-1},{"id":7768,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":3986,"granted_by_id":-1},{"id":7767,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":3800,"granted_by_id":-1},{"id":7766,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":6613,"granted_by_id":-1},{"id":7765,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":5351,"granted_by_id":-1},{"id":7764,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":5983,"granted_by_id":-1},{"id":7763,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":701,"granted_by_id":-1},{"id":7762,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":5707,"granted_by_id":-1},{"id":7761,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":255,"granted_by_id":-1},{"id":7760,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":9931,"granted_by_id":-1},{"id":7759,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":-1,"granted_by_id":-1},{"id":7758,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":5543,"granted_by_id":-1},{"id":7757,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":3987,"granted_by_id":-1},{"id":7756,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":7850,"granted_by_id":-1},{"id":7755,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":6653,"granted_by_id":-1},{"id":7754,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":4419,"granted_by_id":-1},{"id":7753,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":5710,"granted_by_id":-1},{"id":7752,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":5401,"granted_by_id":-1},{"id":7751,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":6809,"granted_by_id":-1},{"id":7750,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":169,"granted_by_id":-1},{"id":7749,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":766,"granted_by_id":-1},{"id":7748,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":1612,"granted_by_id":-1},{"id":7747,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":6019,"granted_by_id":-1},{"id":7746,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":3724,"granted_by_id":-1},{"id":7745,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":1556,"granted_by_id":-1},{"id":7744,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":4063,"granted_by_id":-1},{"id":7743,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":1621,"granted_by_id":-1},{"id":7742,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":3095,"granted_by_id":-1},{"id":7741,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":754,"granted_by_id":-1},{"id":7740,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":6548,"granted_by_id":-1},{"id":7739,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":4457,"granted_by_id":-1},{"id":7738,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":5160,"granted_by_id":-1},{"id":7737,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":10150,"granted_by_id":-1},{"id":7736,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":1,"granted_by_id":-1},{"id":7735,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":1995,"granted_by_id":-1},{"id":7734,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":9536,"granted_by_id":-1},{"id":7733,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":5559,"granted_by_id":-1},{"id":7732,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":6626,"granted_by_id":-1},{"id":7731,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":562,"granted_by_id":-1},{"id":7730,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":2770,"granted_by_id":-1},{"id":7729,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":4385,"granted_by_id":-1},{"id":7728,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":8222,"granted_by_id":-1},{"id":7727,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":1274,"granted_by_id":-1},{"id":7726,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":15,"granted_by_id":-1},{"id":7725,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":5199,"granted_by_id":-1},{"id":7724,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":2316,"granted_by_id":-1},{"id":7723,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":393,"granted_by_id":-1},{"id":7722,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":8492,"granted_by_id":-1},{"id":7721,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":5002,"granted_by_id":-1},{"id":7720,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":2544,"granted_by_id":-1},{"id":7719,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":8342,"granted_by_id":-1},{"id":7718,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":1128,"granted_by_id":-1},{"id":7717,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":2477,"granted_by_id":-1},{"id":7716,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":4549,"granted_by_id":-1},{"id":7715,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":7264,"granted_by_id":-1},{"id":7714,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":413,"granted_by_id":-1},{"id":7713,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":8658,"granted_by_id":-1},{"id":7712,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":5294,"granted_by_id":-1},{"id":7711,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":4750,"granted_by_id":-1},{"id":7710,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":2735,"granted_by_id":-1},{"id":7709,"granted_at":"2014-07-03T06:36:46.939-04:00","badge_id":9,"user_id":9089,"granted_by_id":-1}]}; diff --git a/test/javascripts/helpers/create-pretender.js.es6 b/test/javascripts/helpers/create-pretender.js.es6 index 3b6d5f68d62..b2cac3adf5f 100644 --- a/test/javascripts/helpers/create-pretender.js.es6 +++ b/test/javascripts/helpers/create-pretender.js.es6 @@ -1,5 +1,3 @@ -/* global console */ - function parsePostData(query) { var result = {}; query.split("&").forEach(function(part) { @@ -60,7 +58,9 @@ export default function() { }; server.unhandledRequest = function(verb, path) { - console.error('Unhandled request in test environment: ' + path + ' (' + verb + ')'); + var error = 'Unhandled request in test environment: ' + path + ' (' + verb + ')'; + window.console.error(error); + throw error; }; return server; diff --git a/test/javascripts/integration/badges-test.js.es6 b/test/javascripts/integration/badges-test.js.es6 new file mode 100644 index 00000000000..50e89fab579 --- /dev/null +++ b/test/javascripts/integration/badges-test.js.es6 @@ -0,0 +1,14 @@ +integration("Badges"); + +test("Visit Badge Pages", function() { + visit("/badges"); + andThen(function() { + ok(exists('.badges-listing tr'), "has a list of badges"); + }); + + visit("/badges/9/autobiographer"); + andThen(function() { + ok(exists('.badges-listing tr'), "has the badge in the listing"); + ok(exists('.badge-user'), "has the list of users with that badge"); + }); +}); diff --git a/test/javascripts/integration/topic-discovery-test.js.es6 b/test/javascripts/integration/topic-discovery-test.js.es6 index 296c4973922..a70ed7a7ec5 100644 --- a/test/javascripts/integration/topic-discovery-test.js.es6 +++ b/test/javascripts/integration/topic-discovery-test.js.es6 @@ -20,6 +20,6 @@ test("Visit Discovery Pages", function() { visit("/top"); andThen(function() { - ok(exists('.topic-list .topic-list-item'), "has topics"); + ok(exists('.topic-list tr td.main-link'), "has topics"); }); });