diaspora/spec/helpers/layout_helper_spec.rb
Jonne Haß b8128d356b Merge branch 'hotfix/0.0.2.4' into develop
Conflicts:
	Changelog.md
	app/views/people/show.html.haml
	config/defaults.yml
	spec/helpers/layout_helper_spec.rb
2013-02-01 22:24:37 +01:00

34 lines
989 B
Ruby

# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
require 'spec_helper'
describe LayoutHelper do
describe "#set_current_user_in_javascript" do
it "doesn't allow xss" do
user = FactoryGirl.create :user
profile = user.profile
profile.update_attribute(:first_name, "</script><script>alert(0);</script>");
stub!(:user_signed_in?).and_return true
stub!(:current_user).and_return user
set_current_user_in_javascript.should_not be_empty
set_current_user_in_javascript.should_not include(profile.first_name)
end
end
describe "#page_title" do
context "passed blank text" do
it "returns Diaspora*" do
page_title.should == pod_name
end
end
context "passed text" do
it "returns the text" do
text = "This is the title"
page_title(text).should == text
end
end
end
end