Permalink
Browse files

fix jasmine

  • Loading branch information...
1 parent 6e9d5f0 commit 8fb3ad710ff12fb36e3f953891da85acf39766ca @danielgrippi danielgrippi committed Feb 8, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 spec/javascripts/app/views/post_view_spec.js
@@ -63,21 +63,21 @@ describe("app.views.Post", function(){
context("NSFW", 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 statusElement = $(view.el)
- expect(statusElement.find(".shield").html()).toBeNull();
+ expect(statusElement.find(".shield").length).toBe(1)
})
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 statusElement = $(view.el)
- expect(statusElement.find(".shield").html()).toNotBe(null);
+ expect(statusElement.find(".shield").html()).toBe(null);
})
})
})

6 comments on commit 8fb3ad7

@Raven24
Member
Raven24 commented on 8fb3ad7 Feb 8, 2012

shouldn't that be exactly the other way around?

@maxwell
Member
maxwell commented on 8fb3ad7 Feb 8, 2012

if it is NSFW, it has a shield?

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

@Raven24
Member
Raven24 commented on 8fb3ad7 Feb 8, 2012

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

@OhaiBBQ
Member
OhaiBBQ commented on 8fb3ad7 Feb 8, 2012

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
Member
Raven24 commented on 8fb3ad7 Feb 8, 2012

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

  • red line means "deleted"
@maxwell
Member
maxwell commented on 8fb3ad7 Feb 9, 2012

:) <3

Please sign in to comment.