{"size": 1305, "ext": "js", "max_stars_repo_path": "test/index.test.js", "max_stars_repo_name": "killmenot/browl-plugin-settings-config-nginx-adapter", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "test/index.test.js", "max_issues_repo_name": "killmenot/browl-plugin-settings-config-nginx-adapter", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/index.test.js", "max_forks_repo_name": "killmenot/browl-plugin-settings-config-nginx-adapter", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.0769230769, "max_line_length": 62, "alphanum_fraction": 0.5923371648}
'use strict';

const NullStrategy = require('browl-null');
const settingsConfigNginxAdapterPlugin = require('../');

describe('browl-plugin-settings-config-nginx-adapter', () => {
  let repo;
  let rootConfig;
  let repoConfig;

  let strategy;

  beforeEach(() => {
    repo = 'webapp';
    rootConfig = {
      conf_dir: '/etc/browl'
    };
    repoConfig = {};

    strategy = new NullStrategy(repo, rootConfig, repoConfig);
  });

  describe('#getTemplateData', () => {
    it('should return config data', () => {
      const expected = {
        foo: 'bar'
      };

      repoConfig.settingsConfig = {
        config: {
          foo: 'bar'
        }
      };

      settingsConfigNginxAdapterPlugin(strategy);

      const actual = strategy.getTemplateData();

      expect(actual).eql(expected);
    });

    it('should return empty config #1', () => {
      const expected = {};

      repoConfig.settingsConfig = {};

      settingsConfigNginxAdapterPlugin(strategy);

      const actual = strategy.getTemplateData();

      expect(actual).eql(expected);
    });

    it('should return empty config #2', () => {
      const expected = {};

      settingsConfigNginxAdapterPlugin(strategy);

      const actual = strategy.getTemplateData();

      expect(actual).eql(expected);
    });
  });
});
