diff --git a/app/controllers/report_controller.rb b/app/controllers/report_controller.rb index 3d9c4a5a4..94eee8880 100644 --- a/app/controllers/report_controller.rb +++ b/app/controllers/report_controller.rb @@ -9,7 +9,7 @@ class ReportController < ApplicationController use_bootstrap_for :index def index - @reports = Report.where(reviewed: false).all + @reports = Report.where(reviewed: false) end def update diff --git a/app/models/poll.rb b/app/models/poll.rb index e2fe845a3..416557b5c 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -1,7 +1,7 @@ class Poll < ActiveRecord::Base include Diaspora::Federated::Base include Diaspora::Guid - attr_accessible :question, :poll_answers + belongs_to :status_message has_many :poll_answers has_many :poll_participations @@ -14,7 +14,7 @@ class Poll < ActiveRecord::Base validate :enough_poll_answers validates :question, presence: true - + self.include_root_in_json = false def enough_poll_answers diff --git a/spec/javascripts/app/views/bookmarklet_view_spec.js b/spec/javascripts/app/views/bookmarklet_view_spec.js index 24015c68e..42c363407 100644 --- a/spec/javascripts/app/views/bookmarklet_view_spec.js +++ b/spec/javascripts/app/views/bookmarklet_view_spec.js @@ -49,12 +49,12 @@ describe('app.views.Bookmarklet', function() { }); it('keeps the publisher disabled after successful post creation', function() { - jasmine.Ajax.useMock(); + jasmine.Ajax.install(); init_bookmarklet(test_data); spec.content().find('form').submit(); - mostRecentAjaxRequest().response({ + jasmine.Ajax.requests.mostRecent().response({ status: 200, // success! responseText: "{}" }); diff --git a/spec/javascripts/app/views/poll_view_spec.js b/spec/javascripts/app/views/poll_view_spec.js index 1fa4442dd..d2b30e889 100644 --- a/spec/javascripts/app/views/poll_view_spec.js +++ b/spec/javascripts/app/views/poll_view_spec.js @@ -23,13 +23,13 @@ describe("app.views.Poll", function(){ describe("vote", function(){ it("checks the ajax call for voting", function(){ - spyOn($, "ajax"); + jasmine.Ajax.install(); var answer = this.view.poll.poll_answers[0]; var poll = this.view.poll; this.view.vote(answer.id); - var obj = JSON.parse($.ajax.mostRecentCall.args[0].data); + var obj = jasmine.Ajax.requests.mostRecent().params); expect(obj.poll_id).toBe(poll.poll_id); expect(obj.poll_answer_id).toBe(answer.id); }) diff --git a/spec/javascripts/osmlocator-spec.js b/spec/javascripts/osmlocator-spec.js index 173ea4a5b..dbd6bcf3d 100644 --- a/spec/javascripts/osmlocator-spec.js +++ b/spec/javascripts/osmlocator-spec.js @@ -1,5 +1,6 @@ describe("Locator", function(){ - navigator.geolocation['getCurrentPosition'] = function(myCallback){ + navigator.geolocation = {}; + navigator.geolocation.getCurrentPosition = function(myCallback){ lat = 1; lon = 2; position = { coords: { latitude: lat, longitude: lon} } diff --git a/spec/lib/diaspora/message_renderer_spec.rb b/spec/lib/diaspora/message_renderer_spec.rb index 0366720eb..a0b428250 100644 --- a/spec/lib/diaspora/message_renderer_spec.rb +++ b/spec/lib/diaspora/message_renderer_spec.rb @@ -115,17 +115,17 @@ describe Diaspora::MessageRenderer do it "should leave tags intact" do expect( message("I love #markdown").markdownified - ).to match %r{#markdown} + ).to match %r{#markdown} end it 'should leave multi-underscore tags intact' do expect( message("Here is a #multi_word tag").markdownified - ).to match %r{Here is a #multi_word tag} + ).to match %r{Here is a #multi_word tag} expect( message("Here is a #multi_word_tag yo").markdownified - ).to match %r{Here is a #multi_word_tag yo} + ).to match %r{Here is a #multi_word_tag yo} end it "should leave mentions intact" do @@ -147,7 +147,7 @@ describe Diaspora::MessageRenderer do it 'should process text with both a hashtag and a link' do expect( message("Test #tag?\nhttps://joindiaspora.com\n").markdownified - ).to eq %{
Test #tag?
\nhttps://joindiaspora.com
Test #tag?
\nhttps://joindiaspora.com