spec/groupdocs/document_spec.rb in groupdocs-0.2.11 vs spec/groupdocs/document_spec.rb in groupdocs-0.3.0
- old
+ new
@@ -125,28 +125,28 @@
subject.access_mode!(client_id: 'client_id', private_key: 'private_key')
end.should_not raise_error(ArgumentError)
end
it 'returns access mode in human readable presentation' do
- subject.should_receive(:parse_access_mode).with(0).and_return(:private)
+ subject.should_receive(:parse_access_mode).with('Private').and_return(:private)
subject.access_mode!.should == :private
end
end
describe '#access_mode_set!' do
before(:each) do
- mock_api_server('{"status": "Ok", "result": {"access": 0 }}')
+ mock_api_server('{"status": "Ok", "result": {"access": "Private" }}')
end
it 'accepts access credentials hash' do
lambda do
subject.access_mode_set!(:private, client_id: 'client_id', private_key: 'private_key')
end.should_not raise_error(ArgumentError)
end
- it 'sets corresponding access mode and determines set' do
- subject.should_receive(:parse_access_mode).with(:private).and_return(0)
- subject.should_receive(:parse_access_mode).with(0).and_return(:private)
+ it 'sets corresponding access mode' do
+ described_class::ACCESS_MODES.should_receive(:[]).with(:private).and_return(0)
+ subject.should_receive(:parse_access_mode).with('Private').and_return(:private)
subject.access_mode_set!(:private)
end
it 'returns set of access modes' do
subject.access_mode_set!(:private).should == :private