BigW Consortium Gitlab

variables_spec.rb 655 Bytes
Newer Older
1 2 3
require 'spec_helper'

describe "Variables" do
4 5
  let(:user) { create(:user) }
  before { login_as(user) }
6 7 8

  describe "specific runners" do
    before do
9 10
      @project = FactoryGirl.create :empty_project
      @project.team << [user, :master]
11 12 13
    end

    it "creates variable", js: true do
14
      visit namespace_project_variables_path(@project.namespace, @project)
15 16 17 18
      click_on "Add a variable"
      fill_in "Key", with: "SECRET_KEY"
      fill_in "Value", with: "SECRET_VALUE"
      click_on "Save changes"
19

20
      expect(page).to have_content("Variables were successfully updated.")
21
      expect(@project.variables.count).to eq(1)
22 23 24
    end
  end
end