Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds '/2/files/create_folder_batch' endpoint #60

Merged
merged 2 commits into from
Apr 19, 2019

Conversation

DeadlockDruid
Copy link
Contributor

@Jesus Jesus merged commit cf88b8f into Jesus:master Apr 19, 2019
@client.create_folder_batch(["/Create Batch 4", "/Create Batch 5"], { :async => true })
}.to raise_error(ArgumentError)
end
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/TrailingBlankLines: Final newline missing.


it "raises error, when invalid option is passed", :cassette => "create_folder_batch/invalid_option" do
expect {
@client.create_folder_batch(["/Create Batch 4", "/Create Batch 5"], { :async => true })

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Style/BracesAroundHashParameters: Redundant curly braces around a hash parameter.
Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
Metrics/LineLength: Line is too long. [93/80]

end

it "raises error, when invalid option is passed", :cassette => "create_folder_batch/invalid_option" do
expect {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/BlockDelimiters: Avoid using {...} for multi-line blocks.

expect(result).not_to include(a_kind_of(DropboxApi::Errors::FolderConflictError))
end

it "raises error, when invalid option is passed", :cassette => "create_folder_batch/invalid_option" do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
Metrics/LineLength: Line is too long. [104/80]

it "when autorename is true, does not return error for repeated entries", :cassette => "create_folder_batch/autorename_true" do
result = @client.create_folder_batch(["/Create Batch 1", "/Create Batch 1"], { :autorename => true })

expect(result).not_to include(a_kind_of(DropboxApi::Errors::FolderConflictError))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [85/80]

expect(async_result).to have_key("async_job_id")
end

it "returns async_job_id when force_async is true", :cassette => "create_folder_batch/force_async_true" do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
Metrics/LineLength: Line is too long. [108/80]


async_result = @client.create_folder_batch(paths)
expect(async_result).to be_a(Hash)
expect(async_result).to have_key("async_job_id")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.


it "returns async_job_id when large entries are passed", :cassette => "create_folder_batch/large_entries" do
paths = []
100.times { |i| paths << "/Folder #{i}"}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/SpaceInsideBlockBraces: Space missing inside }.

expect(result.last).to be_a(DropboxApi::Metadata::Folder)
end

it "returns async_job_id when large entries are passed", :cassette => "create_folder_batch/large_entries" do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
Metrics/LineLength: Line is too long. [110/80]

end

it "returns the created folders synchronously", :cassette => "create_folder_batch/synchronous_result_success" do
result = @client.create_folder_batch ["/Create Batch", "/Create Batch 1"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants