diff options
Diffstat (limited to 'spec/gitlab_lfs_authentication_spec.rb')
-rw-r--r-- | spec/gitlab_lfs_authentication_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/gitlab_lfs_authentication_spec.rb b/spec/gitlab_lfs_authentication_spec.rb new file mode 100644 index 0000000..f4fee77 --- /dev/null +++ b/spec/gitlab_lfs_authentication_spec.rb @@ -0,0 +1,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 |