Sha256: d3f7865ec11574514a4ec6f4bd1af7b9c19663cc88d36700134510fa1ce63070

Contents?: true

Size: 867 Bytes

Versions: 3

Compression:

Stored size: 867 Bytes

Contents

require 'spec_helper'

describe Maily do
  it "#setup 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([:en, :es, :pt, :fr])
    expect(Maily.base_controller).to eq('ActionController::Base')
    expect(Maily.http_authorization).to be nil
  end

  describe '#allowed_action?' do
    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
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
maily-0.8.2 spec/maily_spec.rb
maily-0.8.1 spec/maily_spec.rb
maily-0.8.0 spec/maily_spec.rb