enju_question 0.1.0.pre12 → 0.1.0.pre13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/answer.rb +1 -1
  3. data/app/models/question.rb +5 -5
  4. data/app/views/questions/_crd.html.erb +4 -4
  5. data/app/views/questions/_solved_facet.html.erb +1 -1
  6. data/app/views/questions/index.rss.builder +5 -5
  7. data/lib/enju_question/version.rb +1 -1
  8. data/spec/cassette_library/Question/test_should_get_crd_search.yml +486 -406
  9. data/spec/cassette_library/QuestionsController/GET_index/When_not_logged_in/should_get_index_with_query.yml +524 -444
  10. data/spec/cassette_library/QuestionsController/GET_index/When_not_logged_in/should_render_crd_xml_template.yml +524 -444
  11. data/spec/controllers/questions_controller_spec.rb +2 -2
  12. data/spec/dummy/config/boot.rb +2 -2
  13. data/spec/dummy/config/initializers/friendly_id.rb +90 -0
  14. data/spec/dummy/db/migrate/133_create_agent_merges.rb +15 -0
  15. data/spec/dummy/db/migrate/134_create_agent_merge_lists.rb +13 -0
  16. data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +1 -1
  17. data/spec/dummy/db/schema.rb +444 -428
  18. data/spec/dummy/db/test.sqlite3 +0 -0
  19. data/spec/dummy/solr/default/data/index/segments.gen +0 -0
  20. data/spec/dummy/solr/default/data/index/segments_1km +0 -0
  21. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002027 +0 -0
  22. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002028 +0 -0
  23. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002029 +0 -0
  24. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002030 +0 -0
  25. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002031 +0 -0
  26. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002032 +0 -0
  27. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002033 +0 -0
  28. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002034 +0 -0
  29. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002035 +0 -0
  30. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002036 +0 -0
  31. data/spec/fixtures/users.yml +1 -1
  32. data/spec/spec_helper.rb +1 -1
  33. data/spec/views/questions/index.rss.builder_spec.rb +22 -0
  34. metadata +43 -35
  35. data/spec/dummy/solr/default/data/index/segments_1c8 +0 -0
  36. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001725 +0 -0
  37. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001726 +0 -0
  38. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001727 +0 -0
  39. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001728 +0 -0
  40. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001729 +0 -0
  41. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001730 +0 -0
  42. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001731 +0 -0
  43. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001732 +0 -0
  44. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001733 +0 -0
  45. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001734 +0 -0
@@ -26,7 +26,7 @@ describe QuestionsController do
26
26
  end
27
27
 
28
28
  it "assigns all questions as @questionsin rss format" do
29
- get :index, :format => 'rss'
29
+ get :index, :format => :rss
30
30
  assigns(:questions).should_not be_nil
31
31
  end
32
32
  end
@@ -40,7 +40,7 @@ describe QuestionsController do
40
40
  end
41
41
 
42
42
  it "should get my index feed" do
43
- get :index, :format => 'rss'
43
+ get :index, :format => :rss
44
44
  response.should be_success
45
45
  assigns(:questions).should eq Question.public_questions.order(:updated_at).page(1)
46
46
  end
@@ -1,5 +1,5 @@
1
1
  require 'rubygems'
2
- gemfile = File.expand_path('../../../../Gemfile', __FILE__)
2
+ gemfile = ENV['BUNDLE_GEMFILE'] || File.expand_path('../../../../Gemfile', __FILE__)
3
3
 
4
4
  if File.exist?(gemfile)
5
5
  ENV['BUNDLE_GEMFILE'] = gemfile
@@ -7,4 +7,4 @@ if File.exist?(gemfile)
7
7
  Bundler.setup
8
8
  end
9
9
 
10
- $:.unshift File.expand_path('../../../../lib', __FILE__)
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,90 @@
1
+ # FriendlyId Global Configuration
2
+ #
3
+ # Use this to set up shared configuration options for your entire application.
4
+ # Any of the configuration options shown here can also be applied to single
5
+ # models by passing arguments to the `friendly_id` class method or defining
6
+ # methods in your model.
7
+ #
8
+ # To learn more, check out the guide:
9
+ #
10
+ # http://norman.github.io/friendly_id/file.Guide.html
11
+
12
+ if Rails::VERSION::MAJOR == 4
13
+ FriendlyId.defaults do |config|
14
+ # ## Reserved Words
15
+ #
16
+ # Some words could conflict with Rails's routes when used as slugs, or are
17
+ # undesirable to allow as slugs. Edit this list as needed for your app.
18
+ config.use :reserved
19
+
20
+ config.reserved_words = %w(new edit index session login logout users admin
21
+ stylesheets assets javascripts images)
22
+
23
+ # ## Friendly Finders
24
+ #
25
+ # Uncomment this to use friendly finders in all models. By default, if
26
+ # you wish to find a record by its friendly id, you must do:
27
+ #
28
+ # MyModel.friendly.find('foo')
29
+ #
30
+ # If you uncomment this, you can do:
31
+ #
32
+ # MyModel.find('foo')
33
+ #
34
+ # This is significantly more convenient but may not be appropriate for
35
+ # all applications, so you must explicity opt-in to this behavior. You can
36
+ # always also configure it on a per-model basis if you prefer.
37
+ #
38
+ # Something else to consider is that using the :finders addon boosts
39
+ # performance because it will avoid Rails-internal code that makes runtime
40
+ # calls to `Module.extend`.
41
+ #
42
+ config.use :finders
43
+ #
44
+ # ## Slugs
45
+ #
46
+ # Most applications will use the :slugged module everywhere. If you wish
47
+ # to do so, uncomment the following line.
48
+ #
49
+ # config.use :slugged
50
+ #
51
+ # By default, FriendlyId's :slugged addon expects the slug column to be named
52
+ # 'slug', but you can change it if you wish.
53
+ #
54
+ # config.slug_column = 'slug'
55
+ #
56
+ # When FriendlyId can not generate a unique ID from your base method, it appends
57
+ # a UUID, separated by a single dash. You can configure the character used as the
58
+ # separator. If you're upgrading from FriendlyId 4, you may wish to replace this
59
+ # with two dashes.
60
+ #
61
+ # config.sequence_separator = '-'
62
+ #
63
+ # ## Tips and Tricks
64
+ #
65
+ # ### Controlling when slugs are generated
66
+ #
67
+ # As of FriendlyId 5.0, new slugs are generated only when the slug field is
68
+ # nil, but if you're using a column as your base method can change this
69
+ # behavior by overriding the `should_generate_new_friendly_id` method that
70
+ # FriendlyId adds to your model. The change below makes FriendlyId 5.0 behave
71
+ # more like 4.0.
72
+ #
73
+ # config.use Module.new {
74
+ # def should_generate_new_friendly_id?
75
+ # slug.blank? || <your_column_name_here>_changed?
76
+ # end
77
+ # }
78
+ #
79
+ # FriendlyId uses Rails's `parameterize` method to generate slugs, but for
80
+ # languages that don't use the Roman alphabet, that's not usually suffient. Here
81
+ # we use the Babosa library to transliterate Russian Cyrillic slugs to ASCII. If
82
+ # you use this, don't forget to add "babosa" to your Gemfile.
83
+ #
84
+ # config.use Module.new {
85
+ # def normalize_friendly_id(text)
86
+ # text.to_slug.normalize! :transliterations => [:russian, :latin]
87
+ # end
88
+ # }
89
+ end
90
+ end
@@ -0,0 +1,15 @@
1
+ class CreateAgentMerges < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :agent_merges do |t|
4
+ t.integer :agent_id, :agent_merge_list_id, :null => false
5
+
6
+ t.timestamps
7
+ end
8
+ add_index :agent_merges, :agent_id
9
+ add_index :agent_merges, :agent_merge_list_id
10
+ end
11
+
12
+ def self.down
13
+ drop_table :agent_merges
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ class CreateAgentMergeLists < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :agent_merge_lists do |t|
4
+ t.string :title
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+
10
+ def self.down
11
+ drop_table :agent_merge_lists
12
+ end
13
+ end
@@ -7,6 +7,6 @@ class CreateSeriesStatementMerges < ActiveRecord::Migration
7
7
  t.timestamps
8
8
  end
9
9
  add_index :series_statement_merges, :series_statement_id
10
- add_index :series_statement_merges, :series_statement_merge_list_id
10
+ add_index :series_statement_merges, :series_statement_merge_list_id, name: "index_series_statement_merges_on_list_id"
11
11
  end
12
12
  end