Skip to content

Commit

Permalink
tests for ActiveAdmin.flash
Browse files Browse the repository at this point in the history
  • Loading branch information
timoschilling committed Aug 26, 2014
1 parent 51806d4 commit 2ea8b82
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
25 changes: 25 additions & 0 deletions spec/javascripts/coffeescripts/jquery.aa.flash.js.coffee
@@ -0,0 +1,25 @@
describe "ActiveAdmin.flash", ->
beforeEach ->
loadFixtures('flashes.html')
@flashes = $(".flashes")

describe "abstract", ->
it "should add a flash box with class and message"
ActiveAdmin.flash.abstract "a abstract message", "abstract"
flash = @flashes.find(".flash")
expect(flash).toHaveClass("abstract")
expect(flash.text()).toHaveClass("a abstract message")

describe "error", ->
it "should add a flash box with class and message"
ActiveAdmin.flash.abstract "a error message"
flash = @flashes.find(".flash")
expect(flash).toHaveClass("error")
expect(flash.text()).toHaveClass("a error message")

describe "notice", ->
it "should add a flash box with class and message"
ActiveAdmin.flash.abstract "a notice message"
flash = @flashes.find(".flash")
expect(flash).toHaveClass("notice")
expect(flash.text()).toHaveClass("a notice message")
2 changes: 2 additions & 0 deletions spec/javascripts/fixtures/flashes.html
@@ -0,0 +1,2 @@
<div class="flashes">
</div>

0 comments on commit 2ea8b82

Please sign in to comment.