query-interface-server 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 304cbafb396d154cfcffef663d9e37d5b478fa65
4
- data.tar.gz: 3b14bc4045f7ad6637eb5e7aeef72b11cb227a59
3
+ metadata.gz: fed8b7439d3f2e04a839c1ba53a70b7571a90d17
4
+ data.tar.gz: 3baa596556cff58beee39a24b581694ea5a8166c
5
5
  SHA512:
6
- metadata.gz: 889f264e1d9e60fb0b3e7bc27d126c1c8c790fd17e2f141ce7f3c15b163151685fa4a0acbca594fe162a7a40a0625b1715a2b7fa1a0f801e25dff381a8014556
7
- data.tar.gz: 1cd5efc902852da170dc3276cc2438ec05159a953181683fabaa290f1c99673f0e7bd71ed8e87d80a7a1a3bd6081eb2b2fc37d33a507355c05625f047aeefd71
6
+ metadata.gz: 0dcbd75eff1e6b87cf0865e28a36596fa313f6661af0cc7573c8974544689820e75d96fe9c6b9277eb059719a47fec8489030ffeef1b36a78e14db316c8fece2
7
+ data.tar.gz: 2e37f8e37a7e9fb64a771d650dd231d8c70fd2112e9afbe483eacbe7fa790b29d1d2617a120b329f9001c2dafd4b273746e4ca2ba6e4ae5061bacd92379ec2b3
@@ -124,7 +124,11 @@ module QueryInterface
124
124
  self.context = self.send(method, param)
125
125
  end
126
126
  self.context = self.default_order if self.context_type == :dataset
127
- respond_with(self.context)
127
+ unless self.context.nil?
128
+ respond_with(self.context)
129
+ else
130
+ render text: "", status: :not_found
131
+ end
128
132
  end
129
133
  end
130
134
  end
@@ -1,7 +1,7 @@
1
1
  module QueryInterface
2
2
  module Server
3
3
 
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
 
6
6
  end
7
7
  end
@@ -149,12 +149,23 @@ describe QueryInterface, type: :controller do
149
149
  controller.query_model.should_receive(:filter).and_return(foos)
150
150
  controller.stub(:default_order).and_return(context)
151
151
  foos.should_receive(:select_all).with(:foo_table).and_return(context)
152
-
153
152
  get :query, transformations: [], format: :json
154
153
  controller.context.should eq(context)
155
154
  assigns(:context).should eq(context)
156
155
  response.should be_ok
157
156
  end
157
+
158
+ it "should respond with 404 when no result can be reached" do
159
+ context = double("context")
160
+ controller.query_model.should_receive(:filter).and_return(foos)
161
+ controller.stub(:default_order).and_return(nil)
162
+ foos.should_receive(:select_all).with(:foo_table).and_return(nil)
163
+ get :query, transformations: [], format: :json
164
+ controller.context.should eq(nil)
165
+ assigns(:context).should eq(nil)
166
+ response.should_not be_ok
167
+ response.status.should eq(404)
168
+ end
158
169
  end
159
170
 
160
171
 
@@ -212,6 +223,7 @@ describe QueryInterface, type: :controller do
212
223
  assigns(:context).should == [1, 2]
213
224
  end
214
225
 
226
+
215
227
  end
216
228
  end
217
229
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: query-interface-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Kopecky <andreas.kopecky@radarservices.com>