diff --git a/plugin.rb b/plugin.rb index c6a1fc4..342b5b9 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1077,7 +1077,7 @@ SQL end end - render text: text + render plain: text end end end diff --git a/spec/controllers/queries_controller_spec.rb b/spec/controllers/queries_controller_spec.rb index 73ef240..d60cfdd 100644 --- a/spec/controllers/queries_controller_spec.rb +++ b/spec/controllers/queries_controller_spec.rb @@ -234,5 +234,11 @@ describe DataExplorer::QueryController do 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