dts测试

This commit is contained in:
huang 2015-07-19 20:39:53 +08:00
parent c198a03a90
commit 5926b2fe81
4 changed files with 51 additions and 0 deletions

5
app/models/dts.rb Normal file
View File

@ -0,0 +1,5 @@
class Dts < ActiveRecord::Base
attr_accessible :Category, :Defect, :Description, :File, :IPLine, :IPLineCode, :Method, :Num, :PreConditions, :Review, :StartLine, :TraceInfo, :Variable, :project_id
belongs_to :project
end

View File

@ -0,0 +1,22 @@
class CreateDts < ActiveRecord::Migration
def change
create_table :dts do |t|
t.string :IPLineCode
t.string :Description
t.string :Num
t.string :Variable
t.string :TraceInfo
t.string :Method
t.string :File
t.string :IPLine
t.string :Review
t.string :Category
t.string :Defect
t.string :PreConditions
t.string :StartLine
t.integer :project_id
t.timestamps
end
end
end

19
spec/factories/dts.rb Normal file
View File

@ -0,0 +1,19 @@
FactoryGirl.define do
factory :dt, :class => 'Dts' do
IPLineCode "MyString"
Description "MyString"
Num "MyString"
Variable "MyString"
TraceInfo "MyString"
Method "MyString"
File "MyString"
IPLine "MyString"
Review "MyString"
Category "MyString"
Defect "MyString"
PreConditions "MyString"
StartLine "MyString"
project_id 1
end
end

5
spec/models/dts_spec.rb Normal file
View File

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe Dts, :type => :model do
pending "add some examples to (or delete) #{__FILE__}"
end