spec/ar_spec_helper.rb in mailee-0.4.3 vs spec/ar_spec_helper.rb in mailee-0.5.0

- old
+ new

@@ -1,15 +1,14 @@ $LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) +require 'rspec' require 'sqlite3' require 'active_record' require 'mailee' -require 'spec' -require 'spec/autorun' -Spec::Runner.configure do |config| - +RSpec.configure do |config| + Mailee::Config.site = "http://api.869a72b17b05a.mailee-api.mailee.me" end db = "mailee-api-test.db" File.unlink(db) rescue nil SQLite3::Database.new(db) @@ -31,6 +30,19 @@ sync_with_mailee end class Bar < ActiveRecord::Base sync_with_mailee :email => :other_email, :name => :other_name, :news => :other_news -end \ No newline at end of file +end + +class FooList < ActiveRecord::Base + set_table_name 'foos' + @@moment = Time.now.strftime('%Y%m%d%H%M%S') + @@list = Mailee::List.create :name => "Foo List #{@@moment}" + sync_with_mailee :list => @@list.name + def self.list + @@list + end + def self.contacts_count + Mailee::List.find(@@list.id).lists_contacts_count + end +end