I've no experience in testing and I was wondering how to test unauthorized route requests on ember qunit
Currently what i've done is this. Goes to a route ( gets sent off ) Looks for div that exists on the authorised route and if the div doesnt exist the Test passes.
visit("/specimen/specimenadd").then(function() {
ok(!exists(".specimenAdd"), "Specimen Add Route is not accessible - OK");
});
Also How to visit given route:
this.route('specimenview', { path: "view-specimen/:specimen_id"});
Edit - Found out how to visit such route
visit("/specimen/view-specimen/1").then(function() {
ok(!exists(".specimenMain"), "Specimen View/1 is not accessible - OK");
});
Cant use given example cause the "specimenList route is unforbidden"
visit("/posts").then(function() {
return click("td a:first");
}).then(function() { // Have first item open });