Skip to content

Commit

Permalink
FIX: exporting result in CSV format was broken
Browse files Browse the repository at this point in the history
  • Loading branch information
arpitjalan committed Oct 4, 2017
1 parent 9fd366a commit 07cb000
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plugin.rb
Expand Up @@ -1077,7 +1077,7 @@ def run
end
end

render text: text
render plain: text
end
end
end
Expand Down
6 changes: 6 additions & 0 deletions spec/controllers/queries_controller_spec.rb
Expand Up @@ -234,5 +234,11 @@ def run_query(id, params = {})
expect(response_json['success']).to eq(false)
expect(response_json['errors'].first).to match(/syntax error/)
end

it "can export data in CSV format" do
q = make_query('SELECT 23 as my_value')
post :run, params: { id: q.id, download: 1 }, format: :csv
expect(response).to be_success
end
end
end

0 comments on commit 07cb000

Please sign in to comment.