Sha256: b8dea6ff3842d22deac3ee3c92bb47303e69389dda24129b1b72f6782a4dceca

Contents?: true

Size: 1.16 KB

Versions: 1

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'

module ShouldaRouting
  module Resources
    describe Base do
      subject { described_class.new(:users, except: :destroy) }

      describe "initialize" do
        it { expect(subject.options).to eq({except: :destroy})}
        it { expect(subject.current).to eq([:users]) }
      end

      describe "#test!" do
        pending
      end

      describe "-#specs_for" do
        pending
      end

      describe "-#actions" do
        it "retuns restful actions definition" do
          actions = {
            :index   => { via: :get },
            :create  => { via: :post },
            :new     => { via: :get, path: "/new" },
            :edit    => { via: :get, path: "/1/edit", params: { id: "1" }},
            :show    => { via: :get, path: "/1", params: { id: "1" }},
            :update  => { via: :put, path: "/1", params: { id: "1" }},
            :destroy => { via: :delete, path: "/1", params: { id: "1" }}
          }
          subject.send(:actions).should eq actions
        end
      end

      describe "-#routeable_actions" do
        pending
      end

      describe "-#unrouteable_actions" do
        pending
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shoulda_routing-0.0.2 spec/shoulda_routing/resources/base_spec.rb