Sha256: 052d09ff754d1e2d23b0611651db354c832d977918303cf5236d2b91e7e87412

Contents?: true

Size: 1.09 KB

Versions: 25

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'

describe "my_accounts/show" do
  fixtures :all

  before(:each) do
    @profile = assign(:profile, profiles(:admin))
  end

  describe "when logged in as Librarian" do
    before(:each) do
      @profile = assign(:profile, profiles(:librarian2))
      user = users(:librarian1)
      view.stub(:current_user).and_return(user)
    end

    it "renders attributes in <p>" do
      allow(view).to receive(:policy).and_return double(update?: true, destroy?: true)
      render
      # Run the generator again with the --webrat flag if you want to use webrat matchers
    end

    it "cannot be deletable by other librarian" do
      allow(view).to receive(:policy).and_return double(update?: true, destroy?: true)
      render
    end
  end

  describe "when logged in as User" do
    before(:each) do
      @profile = assign(:profile, profiles(:user2))
      user = users(:librarian1)
      view.stub(:current_user).and_return(user)
    end

    it "renders attributes in <p>" do
      allow(view).to receive(:policy).and_return double(update?: true, destroy?: true)
      render
    end
  end
end

Version data entries

25 entries across 24 versions & 2 rubygems

Version Path
enju_seed-0.3.6 spec/views/my_accounts/show.html.erb_spec.rb
enju_seed-0.3.5 spec/views/my_accounts/show.html.erb_spec.rb
enju_seed-0.4.0.rc.2 spec/views/my_accounts/show.html.erb_spec.rb
enju_seed-0.3.4 spec/views/my_accounts/show.html.erb_spec.rb
enju_seed-0.4.0.rc.1 spec/views/my_accounts/show.html.erb_spec.rb
enju_seed-0.4.0.beta.3 spec/views/my_accounts/show.html.erb_spec.rb
enju_seed-0.5.0.beta.1 spec/views/my_accounts/show.html.erb_spec.rb
enju_seed-0.4.0.beta.2 spec/views/my_accounts/show.html.erb_spec.rb
enju_seed-0.3.3 spec/views/my_accounts/show.html.erb_spec.rb
enju_seed-0.3.2 spec/views/my_accounts/show.html.erb_spec.rb
enju_seed-0.3.1 spec/views/my_accounts/show.html.erb_spec.rb
enju_seed-0.3.0 spec/views/my_accounts/show.html.erb_spec.rb
enju_seed-0.3.0.rc.1 spec/views/my_accounts/show.html.erb_spec.rb
enju_seed-0.3.0.beta.7 spec/views/my_accounts/show.html.erb_spec.rb
enju_seed-0.3.0.beta.6 spec/views/my_accounts/show.html.erb_spec.rb
enju_seed-0.2.3 spec/views/my_accounts/show.html.erb_spec.rb
enju_seed-0.2.2 spec/views/my_accounts/show.html.erb_spec.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_seed-0.2.0/spec/views/my_accounts/show.html.erb_spec.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_seed-0.2.1/spec/views/my_accounts/show.html.erb_spec.rb
enju_seed-0.2.1 spec/views/my_accounts/show.html.erb_spec.rb