# Offense count: 62
# Configuration parameters: CountComments.
Metrics/ClassLength:
- Max: 1652
+ Max: 1653
# Offense count: 69
Metrics/CyclomaticComplexity:
## Now try with the public user
changeset = changesets(:public_user_first_change)
+ create(:changeset_tag, :changeset => changeset)
new_changeset = changeset.to_xml
new_tag = XML::Node.new "tag"
new_tag["k"] = "tagtesting"
--- /dev/null
+FactoryGirl.define do
+ factory :changeset_tag do
+ sequence(:k) { |n| "Key #{n}" }
+ sequence(:v) { |n| "Value #{n}" }
+
+ # Fixme requires changeset factory
+ changeset_id 1
+ end
+end
+++ /dev/null
-changeset_1_tag_1:
- changeset_id: 1
- k: created_by
- v: test suite yml
-
-changeset_2_tag_1:
- changeset_id: 2
- k: created_by
- v: test suite yml 2
class ChangesetTagTest < ActiveSupport::TestCase
api_fixtures
- def test_changeset_tag_count
- assert_equal 2, ChangesetTag.count
- end
-
def test_length_key_valid
key = "k"
(0..255).each do |i|
end
def test_uniqueness
+ existing = create(:changeset_tag)
tag = ChangesetTag.new
- tag.changeset_id = changeset_tags(:changeset_1_tag_1).changeset_id
- tag.k = changeset_tags(:changeset_1_tag_1).k
- tag.v = changeset_tags(:changeset_1_tag_1).v
+ tag.changeset_id = existing.changeset_id
+ tag.k = existing.k
+ tag.v = existing.v
assert tag.new_record?
assert !tag.valid?
assert_raise(ActiveRecord::RecordInvalid) { tag.save! }
def self.api_fixtures
# print "setting up the api_fixtures"
fixtures :users, :user_roles
- fixtures :changesets, :changeset_tags
+ fixtures :changesets
fixtures :current_nodes, :nodes
set_fixture_class :current_nodes => Node