require 'spec_helper'

describe CrashDump do
  before do
  end

  it "should fail to save a crash dump without a client_type, client_version or description" do
    CrashDump.new(:client_type => "", :client_version => "version", :description => "").should_not be_valid
    CrashDump.new(:client_type => "type", :client_version => "", :description => "").should_not be_valid
    CrashDump.new(:client_type => "type", :client_version => "1.0", :description => "").should_not be_valid
  end

  it "should be able to save a crash dump with JUST a client_type, client_version and description" do
    @cd = CrashDump.new
    @cd.client_type = "Win32"
    @cd.client_version = "version"
    @cd.description = "crash"
    @cd.should be_valid
    @cd.save

    CrashDump.first.id.should == @cd.id
  end

end
