Skip to content

Commit

Permalink
Fix specs after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Sofaer committed Jul 11, 2011
1 parent eafe6a7 commit e59f49a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion app/controllers/invitations_controller.rb
Expand Up @@ -34,7 +34,7 @@ def create
end
end

good_emails.each{|e| pp Resque.enqueue(Job::InviteUserByEmail, current_user.id, e, aspect, message)}
good_emails.each{|e| Resque.enqueue(Job::InviteUserByEmail, current_user.id, e, aspect, message)}

if bad_emails.any?
flash[:error] = I18n.t('invitations.create.sent') + good_emails.join(', ') + " "+ I18n.t('invitations.create.rejected') + bad_emails.join(', ')
Expand Down
6 changes: 3 additions & 3 deletions spec/controllers/aspects_controller_spec.rb
Expand Up @@ -65,7 +65,7 @@ class FakeError < RuntimeError; attr_accessor :original_exception; end

it 'generates a jasmine fixture with posts', :fixture => true do
message = alice.post(:status_message, :text => "hello "*800, :to => @alices_aspect_2.id)
4.times { bob.comment("what", :post => message) }
3.times { bob.comment("what", :post => message) }
get :index
save_fixture(html_for("body"), "aspects_index_with_posts")

Expand All @@ -90,13 +90,13 @@ class FakeError < RuntimeError; attr_accessor :original_exception; end
response.should_not be_redirect
end
end

context 'with no aspects' do
before do
alice.aspects.each { |aspect| aspect.destroy }
alice.reload
end

it 'redirects to the new aspect page' do
get :index
response.should redirect_to new_aspect_path
Expand Down
20 changes: 10 additions & 10 deletions spec/javascripts/stream-spec.js
Expand Up @@ -12,10 +12,10 @@ describe("Stream", function() {

describe("setUpLives", function() {

it("attaches a click event to show_post_comments links", function() {
it("attaches a click event to toggle_post_comments links", function() {
spyOn(Stream, "toggleComments");
Stream.initializeLives();
$('.stream a.show_post_comments').click();
$('.stream a.toggle_post_comments').click();
expect(Stream.toggleComments).toHaveBeenCalled();
});

Expand All @@ -37,26 +37,26 @@ describe("Stream", function() {
});

describe("toggleComments", function() {
it("toggles class hidden on the comment block", function () {
link = $("a.show_post_comments");
expect(jQuery('ul.comments .older_comments')).toHaveClass("hidden");
it("toggles class hidden on the comments ul", function () {
link = $("a.toggle_post_comments");
expect(jQuery('ul.comments')).not.toHaveClass("hidden");
Stream.toggleComments.call(
link, {preventDefault: function(){} }
);
jasmine.Clock.tick(200);
expect(jQuery('ul.comments .older_comments')).not.toHaveClass("hidden");
expect(jQuery('ul.comments')).toHaveClass("hidden");
});

it("changes the text on the show comments link", function() {
link = $("a.show_post_comments");
link = $("a.toggle_post_comments");
Diaspora.widgets.i18n.loadLocale(
{'comments' : {'hide': 'comments.hide pl'}}, 'en');
expect(link.text()).toEqual("Show 1 more comments");
{'comments' : {'show': 'comments.show pl'}}, 'en');
expect(link.text()).toEqual("Hide all comments");
Stream.toggleComments.call(
link, {preventDefault: function(){} }
);
jasmine.Clock.tick(200);
expect(link.text()).toEqual("comments.hide pl");
expect(link.text()).toEqual("comments.show pl");
});
});
});
6 changes: 1 addition & 5 deletions spec/lib/fake_spec.rb
Expand Up @@ -8,7 +8,7 @@
@people << post.author
4.times do
comment = Factory(:comment, :post => post)
@people << comment.author
comment.author
end
@posts << post
end
Expand Down Expand Up @@ -41,10 +41,6 @@
@fakes.should_receive(:people_hash).and_return({})
@fake.author
end
it 'refers to its comments array for comments' do
@fake.comments = [mock()]
@fake.comments
end
it 'refers to its post for any other field' do
@post.should_receive(:text)
@fake.text
Expand Down

0 comments on commit e59f49a

Please sign in to comment.