-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: migrate resource unit test to rspec test
Signed-off-by: Sergey Gaychuk <[email protected]>
- Loading branch information
1 parent
870a0ab
commit b0293d5
Showing
7 changed files
with
70 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ log/*.log | |
tmp/**/* | ||
.idea | ||
.rspec | ||
vendor/bundle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright (C) 2011 Sergey Yanovich <[email protected]> | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation; either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# Please see ./COPYING for details | ||
|
||
class Asset < ActiveRecord::Base | ||
validates_presence_of :tag | ||
validates_uniqueness_of :tag | ||
has_many :deal_gives, :class_name => "Deal", :as => :give | ||
has_many :deal_takes, :class_name => "Deal", :as => :take | ||
end | ||
|
||
# vim: ts=2 sts=2 sw=2 et: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright (C) 2011 Sergey Yanovich <[email protected]> | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation; either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# Please see ./COPYING for details | ||
|
||
require 'spec_helper' | ||
|
||
describe Asset do | ||
it "should have next behaviour" do | ||
Factory(:asset) | ||
should validate_presence_of :tag | ||
should validate_uniqueness_of :tag | ||
should have_many :deal_gives | ||
should have_many :deal_takes | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright (C) 2011 Sergey Yanovich <[email protected]> | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation; either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# Please see ./COPYING for details | ||
|
||
require 'spec_helper' | ||
|
||
describe Money do | ||
it "should have next behaviour" do | ||
Factory(:money) | ||
should validate_presence_of :num_code | ||
should validate_presence_of :alpha_code | ||
should validate_uniqueness_of :num_code | ||
should validate_uniqueness_of :alpha_code | ||
should have_many :deal_gives | ||
should have_many :deal_takes | ||
should have_many :quotes | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.