Sha256: 3a4c34c180152c816a0eda68e9bd34174eba4617ec8be19ad9bfaecb660b4a45

Contents?: true

Size: 1.21 KB

Versions: 3

Compression:

Stored size: 1.21 KB

Contents

require File.expand_path "lib/rakismet"
require 'ostruct'

RSpec.configure do |config|
  config.mock_with :rspec
end

class AkismetModel
  include Rakismet::Model
end

def comment_attrs(attrs={})
  { :comment_type => 'test', :author => 'Rails test',
    :author_email => 'test@test.host', :author_url => 'test.host',
    :content => 'comment content', :blog => Rakismet.url }.merge(attrs)
end

def akismet_attrs(attrs={})
  { :comment_type => 'test', :comment_author_email => 'test@test.host',
    :comment_author => 'Rails test', :comment_author_url => 'test.host',
    :comment_content => 'comment content' }.merge(attrs)
end

def request
  OpenStruct.new(:user_ip => '127.0.0.1',
                 :user_agent => 'RSpec',
                 :referrer => 'http://test.host/referrer')
end

def request_with_headers
  OpenStruct.new(:user_ip => '127.0.0.1',
                 :user_agent => 'RSpec',
                 :referrer => 'http://test.host/referrer',
                 :http_headers => { 'HTTP_USER_AGENT' => 'RSpec', 'HTTP_REFERER' => 'http://test.host/referrer' } )  
end

def empty_request
  OpenStruct.new(:user_ip => nil,
                 :user_agent => nil,
                 :referrer => nil,
                 :http_headers => nil)
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rakismet-1.5.2 spec/spec_helper.rb
rakismet-1.5.1 spec/spec_helper.rb
rakismet-1.5.0 spec/spec_helper.rb