Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-2547

Refactor blocks code to make them more unit-testable.

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Should have Should have
    • None
    • 2
    • Sprint #52, Sprint #53

      Refactor the Blocks main Controller code and each one of the blocks controllers by separating the concerns of the prepare_template method.

      The prepare_template method should be concerned only with rendering the template and the prepare_data method should be concerned only with getting the data which will be used for rendering the template.

      This way we can Unit test the code that prepares the data without testing also the rendering of the data.

      Example: https://github.com/greenpeace/planet4-plugin-blocks/pull/319/files#diff-444c4d5cd65d7f628be7060f213ecae9

       

      kkokkoro kdiamant sdeshmuk

            atheodor Angelos Theodorakopoulos
            atheodor Angelos Theodorakopoulos
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: