Fix specs

openid
Marcin Kulik 12 years ago
parent a02fdd7777
commit 668f382a69

@ -55,7 +55,8 @@ class AsciicastsController < ApplicationController
:notice => 'Asciicast was deleted.'
else
redirect_to asciicast_path(@asciicast),
:alert => "Oops, we couldn't remove this asciicast. Try again later."
:alert => "Oops, we couldn't remove this asciicast. " \
"Try again later."
end
end

@ -29,4 +29,8 @@ class ApplicationDecorator < Draper::Base
def as_json(*args)
model.as_json(*args)
end
def markdown(text)
MKD_SAFE_RENDERER.render(text).html_safe
end
end

@ -102,7 +102,7 @@ class AsciicastDecorator < ApplicationDecorator
def formatted_description
text = model.description.to_s
MKD_SAFE_RENDERER.render(text).html_safe
markdown(text)
end
def author_profile_link(options = {})
@ -113,7 +113,10 @@ class AsciicastDecorator < ApplicationDecorator
img = ""
end
h.link_to img + "~#{asciicast.user.nickname}", h.profile_path(asciicast.user)
text = img + "~#{asciicast.user.nickname}"
path = h.profile_path(asciicast.user)
h.link_to text, path
else
if asciicast.username.present?
"~#{asciicast.username}"

@ -11,7 +11,8 @@ class User < ActiveRecord::Base
validates_uniqueness_of \
:nickname,
:message => "Sorry, but your nickname is already taken, choose different one"
:message => "Sorry, but your nickname is already taken, " \
"choose different one"
has_many :user_tokens, :dependent => :destroy
has_many :asciicasts, :dependent => :destroy

@ -47,7 +47,7 @@ describe FakeController do
get :foo
flash[:notice].should == "Please login"
flash[:notice].should == "Please login first"
should redirect_to(login_path)
end

@ -29,7 +29,7 @@ describe SessionsController do
end
it "should redirects user to root url" do
flash[:notice].should == "Signed in!"
flash[:notice].should == "Logged in!"
should redirect_to(root_url)
end
end
@ -98,7 +98,7 @@ describe SessionsController do
end
it "should redirects to root_url" do
flash[:notice].should == "Signed out!"
flash[:notice].should == "Logged out!"
should redirect_to(root_url)
end
end

@ -1,15 +0,0 @@
require 'spec_helper'
# Specs in this file have access to a helper object that includes
# the DocsHelper. For example:
#
# describe DocsHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# helper.concat_strings("this","that").should == "this that"
# end
# end
# end
describe DocsHelper do
pending "add some examples to (or delete) #{__FILE__}"
end
Loading…
Cancel
Save