Skip to content

Commit

Permalink
fix jasmine
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgrippi committed Feb 8, 2012
1 parent 6e9d5f0 commit 8fb3ad7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/javascripts/app/views/post_view_spec.js
Expand Up @@ -63,21 +63,21 @@ describe("app.views.Post", function(){


context("NSFW", function(){ context("NSFW", function(){
it("contains a shield element", function(){ it("contains a shield element", function(){
this.statusMessage.set({text : "this is safe for work. #sfw"}); this.statusMessage.set({nsfw: true});


var view = new app.views.Post({model : this.statusMessage}).render(); var view = new app.views.Post({model : this.statusMessage}).render();
var statusElement = $(view.el) var statusElement = $(view.el)


expect(statusElement.find(".shield").html()).toBeNull(); expect(statusElement.find(".shield").length).toBe(1)
}) })


it("does not contain a shield element", function(){ it("does not contain a shield element", function(){
this.statusMessage.set({text : "nudie magazine day! #nsfw"}); this.statusMessage.set({nsfw: false});


var view = new app.views.Post({model : this.statusMessage}).render(); var view = new app.views.Post({model : this.statusMessage}).render();
var statusElement = $(view.el) var statusElement = $(view.el)


expect(statusElement.find(".shield").html()).toNotBe(null); expect(statusElement.find(".shield").html()).toBe(null);
}) })
}) })
}) })
Expand Down

6 comments on commit 8fb3ad7

@Raven24
Copy link
Member

@Raven24 Raven24 commented on 8fb3ad7 Feb 8, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't that be exactly the other way around?

@maxwell
Copy link
Member

@maxwell maxwell commented on 8fb3ad7 Feb 8, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it is NSFW, it has a shield?

If it is not, then it does not contain a shield?

@Raven24
Copy link
Member

@Raven24 Raven24 commented on 8fb3ad7 Feb 8, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but the status message text is containing the opposite to what the test tests...

@ohaibbq
Copy link
Member

@ohaibbq ohaibbq commented on 8fb3ad7 Feb 8, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The status message text is irrelevant now since it was removed. What matters now is the 'nsfw' attribute.

It did seem like we were making opposite expectations before. It seems fine now, though.

@Raven24
Copy link
Member

@Raven24 Raven24 commented on 8fb3ad7 Feb 8, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omg sorry, can't read diffs anymore ... minor cerebral blackout

  • red line means "deleted"

@maxwell
Copy link
Member

@maxwell maxwell commented on 8fb3ad7 Feb 9, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:) <3

Please sign in to comment.