-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Readd resolver, update ReadMe and add ability test * Fix embroider-test * Try to readd initializer * Remove note from readme * Fix rollup * Add Acceptance | application test
- Loading branch information
Showing
10 changed files
with
73 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Resolver from 'ember-resolver'; | ||
|
||
Resolver.reopen({ | ||
init() { | ||
this._super(); | ||
this.pluralizedTypes = { | ||
...this.pluralizedTypes, | ||
ability: 'abilities', | ||
}; | ||
}, | ||
}); | ||
|
||
export function initialize() {} | ||
export default { initialize }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Ability } from 'ember-can'; | ||
|
||
export default class extends Ability { | ||
get canCreate() { | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<h1>ember-can tests</h1> | ||
|
||
{{#if (can "create post")}} | ||
<p id="post-ability"> | ||
This only shows up if the ability was loaded. | ||
</p> | ||
{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { module, test } from 'qunit'; | ||
import { visit, currentURL } from '@ember/test-helpers'; | ||
import { setupApplicationTest } from 'test-app/tests/helpers'; | ||
|
||
module('Acceptance | application', function (hooks) { | ||
setupApplicationTest(hooks); | ||
|
||
test('visiting /', async function (assert) { | ||
await visit('/'); | ||
|
||
assert.strictEqual(currentURL(), '/'); | ||
assert.dom('#post-ability').exists(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
module('Unit | Ability | post', function (hooks) { | ||
setupTest(hooks); | ||
|
||
test('it exists', function (assert) { | ||
const ability = this.owner.lookup('ability:post'); | ||
assert.ok(ability); | ||
}); | ||
}); |