ensl.org/spec/controllers/plugin/plugin_controller_spec.rb
2020-03-23 04:10:31 +02:00

29 lines
698 B
Ruby
Executable file

require 'rails_helper'
describe PluginController do
render_views
describe "#user" do
before do
create :group, :donors
create :group, :champions
end
let!(:user) { create :user_with_team }
it "returns user data" do
get :user, params: { id: user.steamid }
expect(response).to have_http_status(:success)
expect(response.body).to include(user.username)
end
it "definitely does not return IP address" do
last_ip = "127.2.4.2"
user.lastip = last_ip
user.save!
get :user, params: { id: user.steamid }
expect(response).to have_http_status(:success)
expect(response).to_not include(last_ip)
end
end
end