Sha256: 5e413e3dd0c997e102632e26b4e8a9bd8576b0a2075060921d0282cbecc778d2

Contents?: true

Size: 710 Bytes

Versions: 2

Compression:

Stored size: 710 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe MailMethod do

  context 'validation' do
    it { should have_valid_factory(:mail_method) }
  end

  context "current" do
    it "should return the first active mail method corresponding to the current environment" do
      method = MailMethod.create(:environment => "test")
      MailMethod.current.should == method
    end
  end

  context "valid?" do
    it "should be false when missing an environment value" do
      method = MailMethod.new
      method.valid?.should be_false
    end
    it "should be valid if it has an environment" do
      method = MailMethod.new(:environment => "foo")
      method.valid?.should be_true
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
MyCommerceapi-1.0.0 core/spec/models/mail_method_spec.rb
MyCommerce-0.0.3 core/spec/models/mail_method_spec.rb