Browse Source

all tests pass

pull/1/head
Nicolae Claudius 10 years ago
parent
commit
066d77963b
  1. 1
      .ruby-version
  2. 4
      Gemfile.lock
  3. 6
      app/controllers/users/records_controller.rb
  4. 4
      spec/support/matchers/be_able_to.rb
  5. 7
      spec/support/rspec.rb

1
.ruby-version

@ -1 +0,0 @@
2.0.0-p247

4
Gemfile.lock

@ -11,10 +11,10 @@ GIT
GIT GIT
remote: git://github.com/clyfe/active_scaffold.git remote: git://github.com/clyfe/active_scaffold.git
revision: edbf575a42813afe7632a00cee9515774e7e7555 revision: 4415c56d5667e150b42a933bda97bbc847768d50
branch: always_use_build branch: always_use_build
specs: specs:
active_scaffold (3.4.9) active_scaffold (3.4.10)
rails (>= 3.2.18, < 5) rails (>= 3.2.18, < 5)
GIT GIT

6
app/controllers/users/records_controller.rb

@ -29,7 +29,7 @@ class Users::RecordsController < UsersController
security_method: :a_record?, type: :member, position: false, confirm: 'Are you sure?' security_method: :a_record?, type: :member, position: false, confirm: 'Are you sure?'
end end
include RecordsControllerCommon include RecordsControllerCommon
with_options(:only => 'modify') do |c| with_options(:only => :modify) do |c|
c.skip_before_filter :ensure_nested_under_domain c.skip_before_filter :ensure_nested_under_domain
c.skip_before_filter :authenticate_user! c.skip_before_filter :authenticate_user!
c.skip_before_filter :set_user_current c.skip_before_filter :set_user_current
@ -46,9 +46,7 @@ class Users::RecordsController < UsersController
return render(:text => MODIFY_ERROR) if @record.type != 'A' return render(:text => MODIFY_ERROR) if @record.type != 'A'
@record.content = params[:ip] || client_remote_ip @record.content = params[:ip] || client_remote_ip
@record.save! @record.save!
respond_with(@record) do |format| render(:text => MODIFY_OK)
format.html {render(:text => MODIFY_OK)}
end
end end
protected protected

4
spec/support/matchers/be_able_to.rb

@ -13,11 +13,11 @@ RSpec::Matchers.define :be_able_to do |*args|
end end
end end
failure_message_for_should do |ability| failure_message do |ability|
"expected to be able to #{args.map(&:inspect).join(" ")}" "expected to be able to #{args.map(&:inspect).join(" ")}"
end end
failure_message_for_should_not do |ability| failure_message_when_negated do |ability|
"expected not to be able to #{args.map(&:inspect).join(" ")}" "expected not to be able to #{args.map(&:inspect).join(" ")}"
end end
end end

7
spec/support/rspec.rb

@ -4,11 +4,14 @@ RSpec.configure do |config|
config.fixture_path = "#{::Rails.root}/spec/fixtures" config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.use_transactional_fixtures = false config.use_transactional_fixtures = false
config.infer_base_class_for_anonymous_controllers = false config.infer_base_class_for_anonymous_controllers = false
config.treat_symbols_as_metadata_keys_with_true_values = true
config.filter_run :focus => true config.filter_run :focus => true
config.run_all_when_everything_filtered = true config.run_all_when_everything_filtered = true
config.order = "random" config.order = "random"
config.infer_spec_type_from_file_location! config.infer_spec_type_from_file_location!
config.expect_with :rspec do |c|
c.syntax = [:should, :expect]
end
end end

Loading…
Cancel
Save