Project

General

Profile

Testing with redmine 3.2

Added by Mario Villarroel almost 8 years ago

Hi, after failing repeatedly, I found that the test_helper file has to have a patch to load the proper fixture files in the plugin test folder, after that, the error about the fixture file location wasn't shown anymore, BUT I still can't test, now it complains about the fixture label symbols with:

NoMethodError: undefined method `stringify_keys' for :failed1:Symbol

The symbol :failed1 is in yaml as follows:

failed1:
    title: meme test
    description: meme test large Lorem ipsum dolor sit amet, consectetur adipiscing elit. In justo urna, elementum sed massa vitae, 
                 tincidunt accumsan massa. Vestibulum fringilla leo nec dolor venenatis, eu rhoncus arcu efficitur. Mauris cursus odio 
                 vitae est tempor, et scelerisque nisl feugiat. Sed auctor ut elit sed commodo. Maecenas porta blandit laoreet. Cras 
                 sagittis sed nulla et consequat. In eget est eget nisi euismod vestibulum vel sit amet ante. In eget ullamcorper lacus.
                 In vel tellus lacus. Donec dolor tortor, bibendum sed odio pretium, vulputate congue risus. Sed nec ornare eros.
    version_major: -1
    version_middle: 0
    version_minor: 0
    producttree_id: 1
    cistatus_id: 0
    parentitem_id: 0
    filename: none.tgz
    md5: 
    parent_type: t

The yaml is included as a fixture at the test beginning, using

fixtures :configitems

The test code is:

  def test_no_version
    ci = Configitem.new(:failed1)
    assert_not ci.save
  end

any clue on how can I use this fixture to do the tests? what am I doing wrong?


Replies (1)

RE: Testing with redmine 3.2 - Added by Mario Villarroel almost 8 years ago

Please disregard this, I've fixed it by setting a variable in the test class with the values and altering them as needed to test each feature, seems like I was misusing the fixtures...

    (1-1/1)