jam-cloud/ruby/spec/jam_ruby/models/crash_dump_spec.rb

25 lines
798 B
Ruby
Raw Permalink Normal View History

2013-08-01 01:46:24 +00:00
require 'spec_helper'
describe CrashDump do
before do
end
2021-04-15 23:46:22 +00:00
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
2013-08-01 01:46:24 +00:00
end
2021-04-15 23:46:22 +00:00
it "should be able to save a crash dump with JUST a client_type, client_version and description" do
2013-08-01 01:46:24 +00:00
@cd = CrashDump.new
@cd.client_type = "Win32"
2013-08-06 15:15:39 +00:00
@cd.client_version = "version"
2021-04-15 23:46:22 +00:00
@cd.description = "crash"
2013-08-01 01:46:24 +00:00
@cd.should be_valid
@cd.save
CrashDump.first.id.should == @cd.id
end
2013-08-09 01:03:41 +00:00
2013-08-01 01:46:24 +00:00
end