wagn 1.16.3 → 1.16.4

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: a7e2d9d01c35b78795669c2b84b2d55b0ad7fb0b
4
- data.tar.gz: 4861c0153a993c85dcf1ae6764ec97ba20348fbf
3
+ metadata.gz: b994654d5455a17be2d4964721aa5a375fff357d
4
+ data.tar.gz: 1813186fec88f14a7f7cfdf2a4240348878408f2
5
5
  SHA512:
6
- metadata.gz: 97e0b8eb2f9bbb194163c2632ae57915703b1c849eb4956f605bda17be48ed392ce15653484eecf591b3d0514ad12a9ec9e0e496edded2961eaeb03fea7e0114
7
- data.tar.gz: 6a863fb25d8df6e19f10033148f9c9d41274100691b0857671a27ad9ea5b3980f5aec370ce2bc1dc9a313c69927bce09b3eee947cf7e223ee781aa8d4c92aadc
6
+ metadata.gz: 79ca207fd0ebb9c1e1b0a7ff371a0601fd1c22b87a08e77e488a33af61f942fe9bd08087390fc1964eca25a9bdb53736b96cf62152d9b135443f4efc804bf31d
7
+ data.tar.gz: 622f2bb924ab6657523bf1dd6f7e13e8f700c27076165304dd186175f4587905d6b3439e82ee5ad2e43f5ff0fea2cb3c298ea43ee614ad67cbb34f98a4bced90
@@ -0,0 +1,44 @@
1
+ @javascript
2
+ Feature: Conflict
3
+ I want to be able to upload files and images.
4
+
5
+ Background:
6
+ Given I am signed in as Joe Admin
7
+
8
+ Scenario: Uploading a file
9
+ When I go to new File
10
+ And I upload the file "file.txt"
11
+ And I wait a sec
12
+ Then I should see "file.txt 9 Bytes"
13
+ When I press "Delete"
14
+ Then I should see "Add file..."
15
+ When I upload the file "file.txt"
16
+ And I wait a sec
17
+ And I fill in "card_name" with "a test file"
18
+ And I press "Submit"
19
+ Then I should see "Download a test file"
20
+
21
+ Scenario: Uploading and changing an image
22
+ When I go to new Image
23
+ And I upload the image "image.png"
24
+ And I wait a sec
25
+ Then I should see "image.png 34.3 KB"
26
+ And I fill in "card_name" with "a test image"
27
+ And I press "Submit"
28
+ Then I should see an image of size "large" and type "png"
29
+ And I edit "a test image"
30
+ And I upload the image "image2.jpg"
31
+ And I wait a sec
32
+ Then I should see "image2.jpg 69.8 KB"
33
+ And I press "Submit"
34
+ Then I should see an image of size "large" and type "jpg"
35
+
36
+ Scenario: Changing a mod image
37
+ When I edit "*logo"
38
+ And I upload the image "image2.jpg"
39
+ And I wait a sec
40
+ Then I should see "image2.jpg 69.8 KB"
41
+ And I press "Submit"
42
+ Then I should see an image of size "large" and type "jpg"
43
+
44
+
@@ -125,6 +125,12 @@ When /^(?:|I )enter "([^"]*)" into "([^"]*)"$/ do |value, field|
125
125
  find( selector ).set value
126
126
  end
127
127
 
128
+ When /^(?:|I )upload the (.+) "(.+)"$/ do |attachment_name, filename|
129
+ script = "$('input[type=file]').css('opacity','1');"
130
+ page.driver.browser.execute_script(script)
131
+ attach_file("card_#{attachment_name}", File.join(Wagn.gem_root,'features', 'support', filename))
132
+ end
133
+
128
134
  Given /^(.*) (is|am) watching "([^\"]+)"$/ do |user, verb, cardname|
129
135
  user = Card::Auth.current.name if user == "I"
130
136
  signed_in_as user do
@@ -312,6 +318,14 @@ Then /^I should see$/ do |text|
312
318
  expect(page).to have_content(text)
313
319
  end
314
320
 
321
+ Then /^I should see a preview image of size (.+)$/ do |size|
322
+ find("span.preview img[src*='#{size}.png']")
323
+ end
324
+
325
+ Then /^I should see an image of size "(.+)" and type "(.+)"$/ do |size, type|
326
+ find("img[src*='#{size}.#{type}']")
327
+ end
328
+
315
329
  Then /^I should see "([^\"]*)" in color (.*)$/ do |text, css_class|
316
330
  page.has_css?(".diff-#{css_class}", text: text)
317
331
  end
@@ -46,6 +46,7 @@ When /^(?:|I )select "([^"]*)" from "([^"]*)"$/ do |value, field|
46
46
  select(value, :from => field)
47
47
  end
48
48
 
49
+
49
50
  # Use this step in conjunction with Rail's datetime_select helper. For example:
50
51
  # When I select "December 25, 2008 10:00" as the date and time
51
52
  When /^(?:|I )select "([^"]*)" as the date and time$/ do |time|
@@ -0,0 +1 @@
1
+ test file
@@ -20,15 +20,6 @@ module Wagn
20
20
  end
21
21
  end
22
22
 
23
- =begin
24
- initializer :load_wagn_config_initializers, :before => :load_config_initializers do
25
- add_path paths, 'lib/wagn/config/initializers', :glob => "**/*.rb"
26
- config.paths['lib/wagn/config/initializers'].existent.sort.each do |initializer|
27
- load(initializer)
28
- end
29
- end
30
- =end
31
-
32
23
  class << self
33
24
  def inherited(base)
34
25
  super
@@ -214,7 +214,9 @@ class WagnGenerator < Rails::Generators::AppBase
214
214
  end
215
215
 
216
216
  else
217
- puts "Review the database configuration in config/database.yml and run 'wagn seed' to complete the installation.\nStart the server with 'wagn server'."
217
+ puts "Now:
218
+ 1. Run `wagn seed` to seed your database (see db configuration in config/database.yml).
219
+ 2. Run `wagn server` to start your server"
218
220
  end
219
221
  end
220
222
 
@@ -73,6 +73,7 @@ namespace :wagn do
73
73
 
74
74
  desc "update wagn gems and database"
75
75
  task :update do
76
+ ENV['NO_RAILS_CACHE'] = 'true'
76
77
  #system 'bundle update'
77
78
  if Wagn.paths["tmp"].existent
78
79
  FileUtils.rm_rf Wagn.paths["tmp"].first, :secure=>true
@@ -100,6 +101,7 @@ namespace :wagn do
100
101
 
101
102
  desc "migrate structure and cards"
102
103
  task :migrate => :environment do
104
+ ENV['NO_RAILS_CACHE'] = 'true'
103
105
  ENV['SCHEMA'] ||= "#{Cardio.gem_root}/db/schema.rb"
104
106
 
105
107
  stamp = ENV['STAMP_MIGRATIONS']
@@ -321,7 +323,7 @@ namespace :wagn do
321
323
  # mark mod files as mod files
322
324
  Card::Auth.as_bot do
323
325
  Card.search( :type=>['in', 'Image', 'File'], :ne=>'' ).each do |card|
324
- if card.mod_file?
326
+ if card.mod_file? || card.codename == 'new_file' || card.codename == 'new_image'
325
327
  puts "skipping #{card.name}: already in code"
326
328
  next
327
329
  else
@@ -19,10 +19,14 @@ class CardController < ActionController::Base
19
19
  before_filter :load_id, :only => [ :read ]
20
20
  before_filter :load_card, :except => [:asset]
21
21
  before_filter :refresh_card, :only=> [ :create, :update, :delete, :rollback ]
22
+ before_filter :init_success_object, :only => [ :create, :update, :delete ]
23
+
24
+
22
25
 
23
26
  layout nil
24
27
 
25
28
  attr_reader :card
29
+ attr_accessor :success
26
30
 
27
31
 
28
32
 
@@ -44,7 +48,9 @@ class CardController < ActionController::Base
44
48
 
45
49
  def delete
46
50
  discard_locations_for card #should be an event
47
- params[:success] ||= 'REDIRECT: *previous'
51
+ if @success.target == card
52
+ @success.target = :previous
53
+ end
48
54
  handle { card.delete }
49
55
  end
50
56
 
@@ -119,15 +125,19 @@ class CardController < ActionController::Base
119
125
  end
120
126
  raise Card::NotFound unless @card
121
127
 
122
- card.select_action_by_params params
128
+ @card.select_action_by_params params
123
129
  Card::Env[:main_name] = params[:main] || (card && card.name) || ''
124
130
 
125
131
  render_errors if card.errors.any?
126
132
  true
127
133
  end
128
134
 
135
+ def init_success_object
136
+ @success = Card::Env[:success] = Card::Success.new(@card.cardname, params[:success])
137
+ end
138
+
129
139
  def refresh_card
130
- @card = card.refresh
140
+ @card = card.refresh
131
141
  end
132
142
 
133
143
  def request_logger
@@ -184,50 +194,23 @@ class CardController < ActionController::Base
184
194
  end
185
195
 
186
196
  def handle
187
- yield ? success : render_errors
197
+ yield ? render_success : render_errors
188
198
  end
189
199
 
190
-
191
-
192
- # success param:
193
- # if nothing card is self
194
- def success
195
- redirect, new_params = !ajax?, {}
196
-
197
- target = case params[:success]
198
- when nil ; '_self'
199
- when Hash
200
- new_params = params[:success]
201
- redirect ||= !!(new_params.delete :redirect)
202
- new_params.delete :id
203
- when /^REDIRECT:\s*(.+)/
204
- redirect=true
205
- $1
206
- else ; params[:success]
207
- end
208
-
209
- target = case target
210
- when '*previous' ; previous_location #could do as *previous
211
- when /^(http|\/)/ ; target
212
- when /^TEXT:\s*(.+)/ ; $1
213
- when '' ; ''
214
- else ; Card.fetch target.to_name.to_absolute(card.cardname), :new=>{}
215
- end
216
-
217
- case
218
- when redirect
219
- target = page_path target.cardname, new_params if Card === target
220
- card_redirect target
221
- when String===target
222
- render :text => target
200
+ def render_success
201
+ @success.name_context = @card.cardname
202
+ if !ajax? || @success.hard_redirect?
203
+ card_redirect @success.to_url
204
+ elsif String === @success.target
205
+ render :text => @success.target
223
206
  else
224
- @card = target
225
- #Card::Env[:params] =
226
- if new_params.delete :soft_redirect
227
- self.params = new_params
207
+ if @success.soft_redirect?
208
+ self.params = @success.params
228
209
  else
229
- self.params.merge! new_params # #need tests. insure we get slot, main...
210
+ self.params.merge! @success.params # #need tests. insure we get slot, main...
230
211
  end
212
+ @card = @success.target
213
+ @card.select_action_by_params params
231
214
  show
232
215
  end
233
216
  end
@@ -279,6 +279,7 @@ describe CardController do
279
279
  get :read, :id=>'mao2', :format=>'jpg'
280
280
  assert_response 200
281
281
  end
282
+
282
283
  end
283
284
 
284
285
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wagn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.3
4
+ version: 1.16.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-08-23 00:00:00.000000000 Z
14
+ date: 2015-09-07 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -33,14 +33,14 @@ dependencies:
33
33
  requirements:
34
34
  - - '='
35
35
  - !ruby/object:Gem::Version
36
- version: 1.16.3
36
+ version: 1.16.4
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - '='
42
42
  - !ruby/object:Gem::Version
43
- version: 1.16.3
43
+ version: 1.16.4
44
44
  description: a wiki approach to stuctured data, dynamic interaction, and web design
45
45
  email:
46
46
  - info@wagn.org
@@ -77,6 +77,7 @@ files:
77
77
  - app/assets/javascripts/jquery.iframe-transport.js
78
78
  - app/assets/javascripts/jquery.ui.autocomplete.html.js
79
79
  - bin/wagn
80
+ - features/attach.feature
80
81
  - features/autonaming.feature
81
82
  - features/conflict.feature
82
83
  - features/flexmail.feature
@@ -98,6 +99,9 @@ files:
98
99
  - features/step_definitions/window_steps.rb
99
100
  - features/structure.feature
100
101
  - features/support/env.rb
102
+ - features/support/file.txt
103
+ - features/support/image.png
104
+ - features/support/image2.jpg
101
105
  - features/support/paths.rb
102
106
  - features/support/scopes.rb
103
107
  - features/support/wagn_env.rb
@@ -754,6 +758,7 @@ signing_key:
754
758
  specification_version: 4
755
759
  summary: structured wiki web platform
756
760
  test_files:
761
+ - features/attach.feature
757
762
  - features/autonaming.feature
758
763
  - features/conflict.feature
759
764
  - features/flexmail.feature
@@ -775,6 +780,9 @@ test_files:
775
780
  - features/step_definitions/window_steps.rb
776
781
  - features/structure.feature
777
782
  - features/support/env.rb
783
+ - features/support/file.txt
784
+ - features/support/image.png
785
+ - features/support/image2.jpg
778
786
  - features/support/paths.rb
779
787
  - features/support/scopes.rb
780
788
  - features/support/wagn_env.rb