tracks/spec/views/notes/_notes.rhtml_spec.rb
Luke Melia 35ae5fc431 Next step in upgrading Tracks to Rails 2.2. Some highlights:
* Ran rake rails:update
* Added old actionwebservice framework
* Updated RSpec and RSpec-Rails
* Removed asset_packager plugin (not compatible, Scott no longer maintaining), and replaced with bundle_fu. See the bundle_fu README for more info.
* Hacks to UJS and ARTS plugins, which are no longer supported. Probably should move off both UJS and RJS.
* Hack to flashobject_helper plugin (upgrade to Rails 2.2-compatible version if/when it comes out.)
* Hack to skinny-spec plugin, for Rails 2.2 compatibility. Should check for official release.
* Hacks to resource_feeder plugin, for Rails 2.2 compatibility. Should check for official release (not likely) or move off it.
* Addressed some deprecation warnings. More to come.
* My mobile mime type hackery is no longer necessary with new Rails features. Yay!
* Updated environment.rb.tmpl with changes

TODO:
* Restore view specs marked pending
* Fix failing integration tests.
* Try selenium tests.
* Investigate OpenID support.
* Address deprecation warnings.
* Consider moving parts of environment.rb to initializers
* Address annoying config.gem warning about highline gem
2008-11-30 00:34:15 -05:00

40 lines
1.6 KiB
Ruby

require File.dirname(__FILE__) + '/../../spec_helper'
describe "/notes/_notes.rhtml" do
before :each do
@project = mock_model(Project, :name => "a project")
@note = mock_model(Note, :body => "this is a note", :project => @project, :project_id => @project.id,
:created_at => Time.now, :updated_at? => false)
# @controller.template.stub!(:apply_behavior)
@controller.template.stub!(:format_date)
# @controller.template.stub!(:render)
# @controller.template.stub!(:form_remote_tag)
end
it "should render" do
pending "figure out how to mock or work with with UJS"
render :partial => "/notes/notes", :locals => {:notes => @note}
response.should have_tag("div.note_footer")
end
it "should auto-link URLs" do
pending "figure out how to mock or work with with UJS"
@note.stub!(:body).and_return("http://www.google.com/")
render :partial => "/notes/notes", :locals => {:notes => @note}
response.should have_tag("a[href=\"http://www.google.com/\"]")
end
it "should auto-link embedded URLs" do
pending "figure out how to mock or work with with UJS"
@note.stub!(:body).and_return("this is cool: http://www.google.com/")
render :partial => "/notes/notes", :locals => {:notes => @note}
response.should have_tag("a[href=\"http://www.google.com/\"]")
end
it "should parse Textile links correctly" do
pending "figure out how to mock or work with with UJS"
@note.stub!(:body).and_return("\"link\":http://www.google.com/")
render :partial => "/notes/notes", :locals => {:notes => @note}
response.should have_tag("a[href=\"http://www.google.com/\"]")
end
end