Merge branch 'master' into features/feeds
This commit is contained in:
commit
8d74123d61
56 changed files with 1042 additions and 758 deletions
35
spec/helpers/application_helper_spec.rb
Normal file
35
spec/helpers/application_helper_spec.rb
Normal file
|
@ -0,0 +1,35 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe ApplicationHelper do
|
||||
context ".gravatar_icon" do
|
||||
context "over http" do
|
||||
it "returns the correct URL to www.gravatar.com" do
|
||||
expected = "http://www.gravatar.com/avatar/f7daa65b2aa96290bb47c4d68d11fe6a?s=40&d=identicon"
|
||||
|
||||
# Pretend we're running over HTTP
|
||||
helper.stub(:request) do
|
||||
request = double('request')
|
||||
request.stub(:ssl?) { false }
|
||||
request
|
||||
end
|
||||
|
||||
helper.gravatar_icon("admin@local.host").should == expected
|
||||
end
|
||||
end
|
||||
|
||||
context "over https" do
|
||||
it "returns the correct URL to secure.gravatar.com" do
|
||||
expected = "https://secure.gravatar.com/avatar/f7daa65b2aa96290bb47c4d68d11fe6a?s=40&d=identicon"
|
||||
|
||||
# Pretend we're running over HTTPS
|
||||
helper.stub(:request) do
|
||||
request = double('request')
|
||||
request.stub(:ssl?) { true }
|
||||
request
|
||||
end
|
||||
|
||||
helper.gravatar_icon("admin@local.host").should == expected
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -39,5 +39,6 @@ end
|
|||
# updated_at :datetime
|
||||
# closed :boolean default(FALSE), not null
|
||||
# position :integer default(0)
|
||||
# critical :boolean default(FALSE), not null
|
||||
#
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ end
|
|||
# Table name: notes
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# note :string(255)
|
||||
# note :text
|
||||
# noteable_id :string(255)
|
||||
# noteable_type :string(255)
|
||||
# author_id :integer
|
||||
|
|
|
@ -18,6 +18,21 @@ describe User do
|
|||
user = User.new(:email => "test@mail.com")
|
||||
user.identifier.should == "test_mail.com"
|
||||
end
|
||||
|
||||
describe "dependent" do
|
||||
before do
|
||||
@user = Factory :user
|
||||
@note = Factory :note,
|
||||
:author => @user,
|
||||
:project => Factory(:project)
|
||||
end
|
||||
|
||||
it "should destroy all notes with user" do
|
||||
Note.find_by_id(@note.id).should_not be_nil
|
||||
@user.destroy
|
||||
Note.find_by_id(@note.id).should be_nil
|
||||
end
|
||||
end
|
||||
end
|
||||
# == Schema Information
|
||||
#
|
||||
|
|
|
@ -22,6 +22,7 @@ describe "Dashboard" do
|
|||
|
||||
it "should have news feed" do
|
||||
within "#news-feed" do
|
||||
page.should have_content("master")
|
||||
page.should have_content(@project.commit.author.name)
|
||||
page.should have_content(@project.commit.safe_message)
|
||||
end
|
||||
|
|
|
@ -72,10 +72,13 @@ describe "Projects" do
|
|||
current_path.should == project_path(@project)
|
||||
end
|
||||
|
||||
it "should beahave like dashboard" do
|
||||
page.should have_content("History")
|
||||
it "should beahave like activities page" do
|
||||
within ".project-update" do
|
||||
page.should have_content("master")
|
||||
page.should have_content(@project.commit.author.name)
|
||||
page.should have_content(@project.commit.safe_message)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe "GET /projects/team" do
|
||||
|
|
|
@ -7,8 +7,9 @@ describe "Top Panel", :js => true do
|
|||
before do
|
||||
visit projects_path
|
||||
fill_in "search", :with => "Ke"
|
||||
sleep(2)
|
||||
find(:xpath, "//ul[contains(@class,'ui-autocomplete')]/li/a[.=\"Keys\"]").click
|
||||
within ".ui-autocomplete" do
|
||||
find(:xpath, "//a[.=\"Keys\"]").click
|
||||
end
|
||||
end
|
||||
|
||||
it "should be on projects page" do
|
||||
|
@ -23,8 +24,9 @@ describe "Top Panel", :js => true do
|
|||
visit project_path(@project)
|
||||
|
||||
fill_in "search", :with => "Commi"
|
||||
sleep(2)
|
||||
find(:xpath, "//ul[contains(@class,'ui-autocomplete')]/li/a[.=\"#{@project.code} / Commits\"]").click
|
||||
within ".ui-autocomplete" do
|
||||
find(:xpath, "//a[.=\"#{@project.code} / Commits\"]").click
|
||||
end
|
||||
end
|
||||
|
||||
it "should be on projects page" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue