ensl.org/spec/controllers/plugin/plugin_controller_spec.rb

30 lines
698 B
Ruby
Raw Normal View History

2019-10-17 18:29:15 +00:00
require 'rails_helper'
describe PluginController do
render_views
2015-11-08 09:41:11 +00:00
describe "#user" do
before do
create :group, :donors
create :group, :champions
end
let!(:user) { create :user_with_team }
2015-11-08 09:41:11 +00:00
it "returns user data" do
2020-03-23 02:10:31 +00:00
get :user, params: { id: user.steamid }
expect(response).to have_http_status(:success)
expect(response.body).to include(user.username)
end
2015-11-08 09:41:11 +00:00
it "definitely does not return IP address" do
2020-03-23 02:10:31 +00:00
last_ip = "127.2.4.2"
user.lastip = last_ip
user.save!
2020-03-23 02:10:31 +00:00
get :user, params: { id: user.steamid }
expect(response).to have_http_status(:success)
2015-11-08 09:41:11 +00:00
expect(response).to_not include(last_ip)
end
end
2015-11-08 09:41:11 +00:00
end