Saya memiliki file berikut:
/spec/controllers/groups_controller_spec.rb
Perintah apa di terminal yang saya gunakan untuk menjalankan spesifikasi itu dan di direktori apa saya menjalankan perintah?
File permata saya:
# Test ENVIRONMENT GEMS
group :development, :test do
gem "autotest"
gem "rspec-rails", "~> 2.4"
gem "cucumber-rails", ">=0.3.2"
gem "webrat", ">=0.7.2"
gem 'factory_girl_rails'
gem 'email_spec'
end
File spesifikasi:
require 'spec_helper'
describe GroupsController do
include Devise::TestHelpers
describe "GET yourgroups" do
it "should be successful and return 3 items" do
Rails.logger.info 'HAIL MARRY'
get :yourgroups, :format => :json
response.should be_success
body = JSON.parse(response.body)
body.should have(3).items # @user1 has 3 permissions to 3 groups
end
end
end
bundle exec rspec spec --help
kami akan memberikan jawabannya: