Sha256: 05b0a0813cd8b7d163b27758750fce3f31a8838a487bea4bbe98390bd4de48d8

Contents?: true

Size: 907 Bytes

Versions: 5

Compression:

Stored size: 907 Bytes

Contents

require 'spec_helper'

describe ProjectsController do

  render_views

  before do
    request.accept = "application/atom+xml"
    response.stub(:content_type) { "application/atom+xml" }
  end

  it "renders view files with tokamak extension" do
    request.accept = "application/atom+xml"
    get :index, :format => :atom
    response.body.should include("<title>index.atom.tokamak</title>")
    response.header["Link"].should == "<http://google.com>; rel=create, <http://google.com/test>; rel=show"
  end

  it "renders view files without explicit format" do
    request.accept = "application/atom+xml"
    get :show, :format => :atom
    response.body.should include("<title>show.tokamak</title>")
  end
  
  it "prefers views with explicit format" do
    request.accept = "application/atom+xml"
    get :new, :format => :atom
    response.body.should include("<title>new.atom.tokamak</title>")
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
restfulie-nosqlite-1.0.4 tests/spec/controllers/integration/projects_controller_spec.rb
restfulie-1.1.1 tests/spec/controllers/integration/projects_controller_spec.rb
restfulie-1.1.0 tests/spec/controllers/integration/projects_controller_spec.rb
restfulie-nosqlite-1.0.3 tests/spec/controllers/integration/projects_controller_spec.rb
restfulie-1.0.3 tests/spec/controllers/integration/projects_controller_spec.rb