Sha256: c486dca055fb5845753153ac96fe9a69f9dc6ddeaeed9cbc4483b9ed38ca5833
Contents?: true
Size: 821 Bytes
Versions: 11
Compression:
Stored size: 821 Bytes
Contents
require "authlogic/test_case" class GroupMessagesDataset < Dataset::Base datasets = [:groups] datasets << :group_sites if defined? Site uses *datasets def load create_message "Normal" create_message "Grouped", :group => groups(:normal) end helpers do def create_message(subject, attributes={}) attributes = message_attributes(attributes.update(:subject => subject)) message = create_model Message, subject.symbolize, attributes end def message_attributes(attributes={}) subject = attributes[:subject] || "Message" symbol = subject.symbolize attributes = { :subject => subject, :body => "This is the #{subject} message" }.merge(attributes) attributes[:site] = sites(:test) if defined? Site attributes end end end
Version data entries
11 entries across 11 versions & 1 rubygems