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. 5
      spec/support/rspec.rb

1
.ruby-version

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

4
Gemfile.lock

@ -11,10 +11,10 @@ GIT
GIT
remote: git://github.com/clyfe/active_scaffold.git
revision: edbf575a42813afe7632a00cee9515774e7e7555
revision: 4415c56d5667e150b42a933bda97bbc847768d50
branch: always_use_build
specs:
active_scaffold (3.4.9)
active_scaffold (3.4.10)
rails (>= 3.2.18, < 5)
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?'
end
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 :authenticate_user!
c.skip_before_filter :set_user_current
@ -46,9 +46,7 @@ class Users::RecordsController < UsersController
return render(:text => MODIFY_ERROR) if @record.type != 'A'
@record.content = params[:ip] || client_remote_ip
@record.save!
respond_with(@record) do |format|
format.html {render(:text => MODIFY_OK)}
end
render(:text => MODIFY_OK)
end
protected

4
spec/support/matchers/be_able_to.rb

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

5
spec/support/rspec.rb

@ -5,10 +5,13 @@ RSpec.configure do |config|
config.use_transactional_fixtures = 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.run_all_when_everything_filtered = true
config.order = "random"
config.infer_spec_type_from_file_location!
config.expect_with :rspec do |c|
c.syntax = [:should, :expect]
end
end

Loading…
Cancel
Save