spec/gitlab_spec.rb in gitlab-3.3.0 vs spec/gitlab_spec.rb in gitlab-3.4.0
- old
+ new
@@ -14,10 +14,15 @@
expect(client1.endpoint).to eq('https://api1.example.com')
expect(client2.endpoint).to eq('https://api2.example.com')
expect(client1.private_token).to eq('001')
expect(client2.private_token).to eq('002')
end
+
+ it "should set private_token to the auth_token when provided" do
+ client = Gitlab.client(endpoint: 'https://api2.example.com', auth_token: '3225e2804d31fea13fc41fc83bffef00cfaedc463118646b154acc6f94747603')
+ expect(client.private_token).to eq('3225e2804d31fea13fc41fc83bffef00cfaedc463118646b154acc6f94747603')
+ end
end
describe ".actions" do
it "should return an array of client methods" do
actions = Gitlab.actions
@@ -36,9 +41,16 @@
describe ".private_token=" do
it "should set private_token" do
Gitlab.private_token = 'secret'
expect(Gitlab.private_token).to eq('secret')
+ end
+ end
+
+ describe ".auth_token=" do
+ it "should set auth_token", focus: true do
+ Gitlab.auth_token = 'auth_secret'
+ expect(Gitlab.private_token).to eq('auth_secret')
end
end
describe ".sudo=" do
it "should set sudo" do