Skip to content
Extraits de code Groupes Projets
Valider d070f192 rédigé par Jonne Haß's avatar Jonne Haß
Parcourir les fichiers

make rspec and jasmine pass with the new code

parent 38e5ae2b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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
......
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
......
......@@ -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: "{}"
});
......
......@@ -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);
})
......
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} }
......
......@@ -115,17 +115,17 @@ describe Diaspora::MessageRenderer do
it "should leave tags intact" do
expect(
message("I love #markdown").markdownified
).to match %r{<a href="/tags/markdown" class="tag">#markdown</a>}
).to match %r{<a class="tag" href="/tags/markdown">#markdown</a>}
end
it 'should leave multi-underscore tags intact' do
expect(
message("Here is a #multi_word tag").markdownified
).to match %r{Here is a <a href="/tags/multi_word" class="tag">#multi_word</a> tag}
).to match %r{Here is a <a class="tag" href="/tags/multi_word">#multi_word</a> tag}
expect(
message("Here is a #multi_word_tag yo").markdownified
).to match %r{Here is a <a href="/tags/multi_word_tag" class="tag">#multi_word_tag</a> yo}
).to match %r{Here is a <a class="tag" href="/tags/multi_word_tag">#multi_word_tag</a> 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 %{<p>Test <a href="/tags/tag" class="tag">#tag</a>?<br>\n<a href="https://joindiaspora.com" target="_blank">https://joindiaspora.com</a></p>\n}
).to eq %{<p>Test <a class="tag" href="/tags/tag">#tag</a>?<br>\n<a href="https://joindiaspora.com" target="_blank">https://joindiaspora.com</a></p>\n}
end
it 'should process text with a header' do
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter