Sha256: 45ef11301963cd4a148616d075c736442dd72bbf6bb22cd9a06a7a6f0f071686

Contents?: true

Size: 746 Bytes

Versions: 2

Compression:

Stored size: 746 Bytes

Contents

require 'spec_helper'

describe Maily do
  it "should set up with defaults if no block 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')
  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.3.3 spec/maily_spec.rb
maily-0.3.2 spec/maily_spec.rb