dorsale 3.7.6 → 3.7.7

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: 81e50babe312e2efc734c4f4a8d7f0330a9d202b
4
- data.tar.gz: 288ebe8ef980c2757c47371d8f31c149b0b0136f
3
+ metadata.gz: 76b8dc71431e1a245a94bd289e89624b8125827b
4
+ data.tar.gz: 5c1c72b5535774ed5dffc5ae8b582bab5f554283
5
5
  SHA512:
6
- metadata.gz: 7aee6d4aad771859b4a6d695ae10f616b48bf7d0052e704103b861131fb3c8025b780a54dea643250cff7feae0af11fad2fe2623db6b9dd57bf82a9af20b1938
7
- data.tar.gz: 6cd4a6e643628440fb561f3dd1c31373b12dac4ca94de30ccf1ea9cb651aa9180bb37f97e9c2c70b55a369db79a3a4c438c4c4471942f2864c2609e76c44c682
6
+ metadata.gz: 4d83ab74ba603fd01a7352ec1027a8882b52b42bbbadf85ad41395d95fe6dfb018d80b2d61550b8b7b992806ac3522019e179fae1444c5ed8a8c3886f62c5c94
7
+ data.tar.gz: 6dbfc36f1024d85150d9d3998f93537c8758ec6c8100036b4251fcc0af1733492ea849d123bbdbb46dc2ecb3312a3fa4a1030dccf1e4d60ee37f638ca4dac50e
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Next version
4
4
 
5
+ ## 3.7.7
6
+
7
+ - Change redirect after create task comment
8
+
5
9
  ## 3.7.6
6
10
 
7
11
  - Add table names on SQL queries
@@ -8,7 +8,7 @@ class Dorsale::Flyboy::TaskCommentsController < ::Dorsale::Flyboy::ApplicationCo
8
8
  authorize @task, :comment?
9
9
 
10
10
  if @task_comment.save
11
- redirect_to @task
11
+ redirect_to back_url
12
12
  else
13
13
  @task_comments = @task.comments
14
14
  render "dorsale/flyboy/tasks/show"
@@ -17,6 +17,10 @@ class Dorsale::Flyboy::TaskCommentsController < ::Dorsale::Flyboy::ApplicationCo
17
17
 
18
18
  private
19
19
 
20
+ def back_url
21
+ request.referer.presence || url_for(@task)
22
+ end
23
+
20
24
  def model
21
25
  ::Dorsale::Flyboy::TaskComment
22
26
  end
@@ -1,6 +1,6 @@
1
1
  When(/^I search "(.*?)"$/) do |q|
2
2
  fill_in "q", with: q
3
- find("form.search button").click
3
+ find(".search-submit").click
4
4
  end
5
5
 
6
6
  When(/^an existing customer$/) do
@@ -14,10 +14,10 @@ end
14
14
 
15
15
  Lorsqu(/^he search an individual by first name$/) do
16
16
  fill_in "q", with: "Jean"
17
+ find(".search-submit").click
17
18
  end
18
19
 
19
20
  Alors(/^this individual appear in search results$/) do
20
- find(".search [type=submit]").click
21
21
  expect(page).to have_content "Jean"
22
22
  expect(page).to have_content "DUPONT"
23
23
  end
@@ -29,14 +29,15 @@ end
29
29
 
30
30
  Lorsqu(/^he search an individual by last name$/) do
31
31
  fill_in "q", with: "DUPONT"
32
+ find(".search-submit").click
32
33
  end
33
34
 
34
35
  Lorsqu(/^he search a corporation by name$/) do
35
36
  fill_in "q", with: "aaa"
37
+ find(".search-submit").click
36
38
  end
37
39
 
38
40
  Alors(/^this corporation appear in search results$/) do
39
- find(".search [type=submit]").click
40
41
  expect(page).to have_content "aaa"
41
42
  expect(page).to have_content "contact@aaa.com"
42
43
  end
@@ -1,3 +1,3 @@
1
1
  module Dorsale
2
- VERSION = "3.7.6"
2
+ VERSION = "3.7.7"
3
3
  end
@@ -11,10 +11,23 @@ describe Dorsale::Flyboy::TaskCommentsController, type: :controller do
11
11
  let(:task_comment) { create(:flyboy_task_comment, task: task) }
12
12
 
13
13
  describe "#create" do
14
+ let(:valid_params) {{task_id: task.id, task_comment: task_comment.attributes}}
15
+
14
16
  it "should create the task_comment" do
15
- post :create, params: {task_id: task.id, task_comment: task_comment.attributes}
17
+ post :create, params: valid_params
16
18
  expect(assigns(:task_comment).persisted?).to be true
17
19
  end
20
+
21
+ it "should redirect to referrer" do
22
+ request.env["HTTP_REFERER"] = "/abc"
23
+ post :create, params: valid_params
24
+ expect(response).to redirect_to "/abc"
25
+ end
26
+
27
+ it "should redirect to task" do
28
+ post :create, params: valid_params
29
+ expect(response).to redirect_to flyboy_task_path(task)
30
+ end
18
31
  end
19
32
 
20
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dorsale
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.6
4
+ version: 3.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - agilidée
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-10 00:00:00.000000000 Z
11
+ date: 2017-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails