Sha256: dc4b28205a87719b8efa230a260b94f8f8b1050bcb8fc43bc537c82ab58596ec

Contents?: true

Size: 805 Bytes

Versions: 2

Compression:

Stored size: 805 Bytes

Contents

require 'spec_helper'

describe Maily do
  it "should initialize with some defaults if no block is provided" do
    Maily.setup

    expect(Maily.enabled).to be true
    expect(Maily.allow_edition).to be true
    expect(Maily.allow_delivery).to be true
    expect(Maily.available_locales).to eq(I18n.available_locales)
    expect(Maily.base_controller).to eq('ActionController::Base')
    expect(Maily.http_authorization).to be nil
  end

  it "should not allow edition if edition is disabled" do
    Maily.allow_edition = false

    expect(Maily.allowed_action?(:edit)).to be false
    expect(Maily.allowed_action?(:update)).to be false
  end

  it "should not allow delivery if delivery is disabled" do
    Maily.allow_delivery = false

    expect(Maily.allowed_action?(:deliver)).to be false
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
maily-0.7.1 spec/maily_spec.rb
maily-0.7.0 spec/maily_spec.rb