Fix specs after merge
This commit is contained in:
parent
eafe6a7c85
commit
e59f49aace
4 changed files with 15 additions and 19 deletions
|
|
@ -34,7 +34,7 @@ class InvitationsController < Devise::InvitationsController
|
|||
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(', ')
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ describe AspectsController do
|
|||
|
||||
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")
|
||||
|
||||
|
|
@ -90,13 +90,13 @@ describe AspectsController do
|
|||
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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
|
||||
|
|
@ -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");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ describe PostsFake do
|
|||
@people << post.author
|
||||
4.times do
|
||||
comment = Factory(:comment, :post => post)
|
||||
@people << comment.author
|
||||
comment.author
|
||||
end
|
||||
@posts << post
|
||||
end
|
||||
|
|
@ -41,10 +41,6 @@ describe PostsFake do
|
|||
@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
|
||||
|
|
|
|||
Loading…
Reference in a new issue