Sha256: 42af91093beb6fbf9808e47e3dbfd309f4ba686a1540b3b77cdb9c75d89208e5

Contents?: true

Size: 1.89 KB

Versions: 10

Compression:

Stored size: 1.89 KB

Contents

require "spec_helper"

RSpec.describe "GitHub" do
  let(:org_name) { "platanus" }
  let(:repo_name) { PotassiumTestHelpers::APP_NAME.dasherize }
  let(:access_token) { "1234" }
  let(:pr_template_file) { IO.read("#{project_path}/.github/pull_request_template.md") }

  before do
    drop_dummy_database
    remove_project_directory
  end

  it "creates the github repository" do
    create_dummy_project(
      "github" => true,
      "github_private" => false,
      "github_has_org" => false,
      "github_name" => repo_name,
      "github_access_token" => access_token
    )

    expect(FakeOctokit).to have_created_repo(repo_name)
    expect(pr_template_file).to include('Contexto')
  end

  it "creates the private github repository" do
    create_dummy_project(
      "github" => true,
      "github_private" => true,
      "github_has_org" => false,
      "github_name" => repo_name,
      "github_access_token" => access_token
    )

    expect(FakeOctokit).to have_created_private_repo(repo_name)
    expect(pr_template_file).to include('Contexto')
  end

  it "creates the github repository for the organization" do
    create_dummy_project(
      "github" => true,
      "github_private" => false,
      "github_has_org" => true,
      "github_org" => org_name,
      "github_name" => repo_name,
      "github_access_token" => access_token
    )

    expect(FakeOctokit).to have_created_repo_for_org(repo_name, org_name)
    expect(pr_template_file).to include('Contexto')
  end

  it "creates the private github repository for the organization" do
    create_dummy_project(
      "github" => true,
      "github_private" => true,
      "github_has_org" => true,
      "github_org" => org_name,
      "github_name" => repo_name,
      "github_access_token" => access_token
    )

    expect(FakeOctokit).to have_created_private_repo_for_org(repo_name, org_name)
    expect(pr_template_file).to include('Contexto')
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
potassium-7.2.0 spec/features/github_spec.rb
potassium-7.1.0 spec/features/github_spec.rb
potassium-7.0.0 spec/features/github_spec.rb
potassium-6.7.0 spec/features/github_spec.rb
potassium-6.6.0 spec/features/github_spec.rb
potassium-6.5.0 spec/features/github_spec.rb
potassium-6.4.0 spec/features/github_spec.rb
potassium-6.3.0 spec/features/github_spec.rb
potassium-6.2.0 spec/features/github_spec.rb
potassium-6.1.0 spec/features/github_spec.rb