summaryrefslogtreecommitdiff
path: root/spec/gitlab_lfs_authentication_spec.rb
blob: f4fee77a57deb77c4bfdc0f72299974c76887c4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'spec_helper'
require 'gitlab_lfs_authentication'

describe GitlabLfsAuthentication do
  let(:user) { { 'username' => 'dzaporozhets', 'lfs_token' => 'wsnys8Zm8Jn7zyhHTAAK' } }

  subject do
    GitlabLfsAuthentication.new(user, 'http://gitlab.dev/repo')
  end

  describe '#initialize' do
    it { subject.user.should == user }
    it { subject.repository_http_path.should == 'http://gitlab.dev/repo' }
  end

  describe '#authenticate!' do
    result = "{\"header\":{\"Authorization\":\"Basic ZHphcG9yb3poZXRzOndzbnlzOFptOEpuN3p5aEhUQUFL\"},\"href\":\"http://gitlab.dev/repo/info/lfs/\"}"

    it { subject.authenticate!.should == result }
  end
end